Socket
Socket
Sign inDemoInstall

asn1.js

Package Overview
Dependencies
Maintainers
2
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asn1.js - npm Package Compare versions

Comparing version 5.4.0 to 5.4.1

27

lib/asn1/decoders/der.js

@@ -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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc