Skip to content

Commit cbb9982

Browse files
authored
ASN.1 tag lengths > 1-byte are not supported (#8)
1 parent 0b52df2 commit cbb9982

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Asn1Decode.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ library Asn1Decode {
209209
}
210210

211211
function readNodeLength(bytes memory der, uint256 ix) private pure returns (Asn1Ptr) {
212+
require(der[ix] & 0x1f != 0x1f, "ASN.1 tags longer than 1-byte are not supported");
212213
uint256 length;
213214
uint80 ixFirstContentByte;
214215
if ((der[ix + 1] & 0x80) == 0) {

0 commit comments

Comments
 (0)