Comparing version 5.4.0 to 5.4.1
@@ -74,2 +74,15 @@ 'use strict'; | ||
if (decodedTag.primitive || len !== null) | ||
return buffer.skip(len, 'Failed to match body of: "' + tag + '"'); | ||
// Indefinite length... find END tag | ||
const state = buffer.save(); | ||
const res = this._skipUntilEnd( | ||
buffer, | ||
'Failed to skip indefinite length body: "' + this.tag + '"'); | ||
if (buffer.isError(res)) | ||
return res; | ||
len = buffer.offset - state.offset; | ||
buffer.restore(state); | ||
return buffer.skip(len, 'Failed to match body of: "' + tag + '"'); | ||
@@ -298,2 +311,6 @@ }; | ||
// Indefinite form | ||
if (!primitive && len === 0x80) | ||
return null; | ||
// Definite form | ||
@@ -308,7 +325,4 @@ if ((len & 0x80) === 0) { | ||
if (num > 4) | ||
return buf.error('length octet is too long'); | ||
return buf.error('length octect is too long'); | ||
if (num === 0) | ||
return buf.error('indefinite length is not allowed in DER'); | ||
len = 0; | ||
@@ -321,10 +335,5 @@ for (let i = 0; i < num; i++) { | ||
len |= j; | ||
len >>>= 1; | ||
} | ||
if (len <= 0x7f) { | ||
return buf.error('long form of length is used for short length'); | ||
} | ||
return len; | ||
} |
{ | ||
"name": "asn1.js", | ||
"version": "5.4.0", | ||
"version": "5.4.1", | ||
"description": "ASN.1 encoder and decoder", | ||
@@ -10,4 +10,3 @@ "main": "lib/asn1.js", | ||
"lint": "eslint --fix lib/*.js lib/**/*.js lib/**/**/*.js && npm run lint-2560 && npm run lint-5280", | ||
"mocha": "mocha --reporter spec test/*-test.js", | ||
"test": "npm run mocha && cd rfc/2560 && npm i && npm test && cd ../../rfc/5280 && npm i && npm test && cd ../../ && npm run lint" | ||
"test": "mocha --reporter spec test/*-test.js && cd rfc/2560 && npm i && npm test && cd ../../rfc/5280 && npm i && npm test && cd ../../ && npm run lint" | ||
}, | ||
@@ -14,0 +13,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49847
1489