Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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 4.7.0 to 4.8.0

15

lib/asn1/base/node.js

@@ -281,3 +281,3 @@ var Reporter = require('../base').Reporter;

var prevKey;
var prevKey = null;
if (state.key !== null)

@@ -351,2 +351,8 @@ prevKey = input.enterKey(state.key);

if (options && options.track && state.tag !== null)
options.track(input.path(), start, input.length, 'tagged');
if (options && options.track && state.tag !== null)
options.track(input.path(), input.offset, input.length, 'content');
// Select proper method for tag

@@ -378,7 +384,2 @@ if (state.any)

}
var end = input.offset;
if (options && options.track)
options.track(input.path(), start, end);
}

@@ -393,2 +394,4 @@

input.leaveKey(prevKey, state.key, result);
else if (prevKey !== null)
input.exitKey(prevKey);

@@ -395,0 +398,0 @@ return result;

8

lib/asn1/base/reporter.js

@@ -34,6 +34,12 @@ var inherits = require('inherits');

Reporter.prototype.exitKey = function exitKey(index) {
var state = this._reporterState;
state.path = state.path.slice(0, index - 1);
};
Reporter.prototype.leaveKey = function leaveKey(index, key, value) {
var state = this._reporterState;
state.path = state.path.slice(0, index - 1);
this.exitKey(index);
if (state.obj !== null)

@@ -40,0 +46,0 @@ state.obj[key] = value;

{
"name": "asn1.js",
"version": "4.7.0",
"version": "4.8.0",
"description": "ASN.1 encoder and decoder",

@@ -5,0 +5,0 @@ "main": "lib/asn1.js",

{
"name": "asn1.js-rfc5280",
"version": "1.0.3",
"version": "1.2.0",
"description": "RFC5280 extension structures for asn1.js",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -27,8 +27,8 @@ var assert = require('assert');

var tracked = {};
var tracked = [];
var encoded = A.encode(input, 'der');
var decoded = A.decode(encoded, 'der', {
track: function(path, start, end) {
tracked[path] = [ start, end ];
track: function(path, start, end, type) {
tracked.push([ type, path, start, end ]);
}

@@ -38,12 +38,19 @@ });

jsonEqual(input, decoded);
assert.deepEqual(tracked, {
'': [ 0, 20 ],
a: [ 4, 12 ],
'a/x': [ 6, 8 ],
'a/y': [ 9, 11 ],
b: [ 12, 20 ],
'b/x': [ 14, 16 ],
'b/y': [ 17, 19 ]
});
assert.deepEqual(tracked, [
[ "tagged", "", 0, 20 ],
[ "content", "", 2, 20 ],
[ "tagged", "a", 4, 12 ],
[ "content", "a", 6, 12 ],
[ "tagged", "a/x", 6, 9 ],
[ "content", "a/x", 8, 9 ],
[ "tagged", "a/y", 9, 12 ],
[ "content", "a/y", 11, 12 ],
[ "tagged", "b", 12, 20 ],
[ "content", "b", 14, 20 ],
[ "tagged", "b/x", 14, 17 ],
[ "content", "b/x", 16, 17 ],
[ "tagged", "b/y", 17, 20 ],
[ "content", "b/y", 19, 20 ]
]);
});
});
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