Comparing version 7.0.8 to 7.0.9
@@ -8,3 +8,3 @@ "use strict"; | ||
if (value.length === 0) { | ||
throw new errors.ASN1SizeError("INTEGER encoded on zero bytes!"); | ||
throw new errors.ASN1SizeError("INTEGER or ENUMERATED encoded on zero bytes"); | ||
} | ||
@@ -14,3 +14,5 @@ if (value.length > 2 | ||
|| (value[0] === 0x00 && value[1] < 0b10000000))) { | ||
throw new errors.ASN1PaddingError("Unnecessary padding bytes on INTEGER or ENUMERATED."); | ||
const buf = Buffer.from(value.slice(0, 16)); | ||
throw new errors.ASN1PaddingError("Unnecessary padding bytes on INTEGER or ENUMERATED. " | ||
+ `First 16 bytes of the offending value were: 0x${buf.toString("hex")}`); | ||
} | ||
@@ -17,0 +19,0 @@ return (0, bigint_1.bufferToInteger)(value); |
@@ -64,3 +64,3 @@ { | ||
"types": "./dist/node/index.d.ts", | ||
"version": "7.0.8" | ||
"version": "7.0.9" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
695917
7738