Skip to content

Commit

Permalink
ASN.1 tag lengths > 1-byte are not supported (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdehoog authored Jan 11, 2025
1 parent 0b52df2 commit cbb9982
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Asn1Decode.sol
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ library Asn1Decode {
}

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

0 comments on commit cbb9982

Please sign in to comment.