@lapo/asn1js 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -101,8 +101,10 @@ credits
101
101
  links
102
102
  -----
103
103
 
104
- - [official website](https://lapo.it/asn1js/)
105
- - [dedicated domain](https://asn1js.eu/)
106
- - [InDefero tracker](http://idf.lapo.it/p/asn1js/)
104
+ - [official website](https://asn1js.eu/)
105
+ - [alternate website](https://lapo.it/asn1js/)
106
+ - [single-file version working locally](https://asn1js.eu/index-local.html) (just save this link)
107
+ - [InDefero tracker](http://idf.lapo.it/p/asn1js/) (currently offline)
107
108
  - [GitHub mirror](https://github.com/lapo-luchini/asn1js)
109
+ - [ChangeLog on GitHub](https://github.com/lapo-luchini/asn1js/blob/trunk/CHANGELOG.md)
108
110
  - [Ohloh code stats](https://www.openhub.net/p/asn1js)
package/asn1.js CHANGED
@@ -461,8 +461,10 @@ export class ASN1 {
461
461
  }
462
462
  switch (this.tag.tagNumber) {
463
463
  case 0x01: // BOOLEAN
464
+ if (len != 1) return 'invalid length ' + len;
464
465
  return (this.stream.get(content) === 0) ? 'false' : 'true';
465
466
  case 0x02: // INTEGER
467
+ if (len < 1) return 'invalid length ' + len;
466
468
  return this.stream.parseInteger(content, content + len);
467
469
  case 0x03: { // BIT_STRING
468
470
  let d = recurse(this, 'parseBitString', maxLength);
@@ -474,6 +476,7 @@ export class ASN1 {
474
476
  }
475
477
  //case 0x05: // NULL
476
478
  case 0x06: // OBJECT_IDENTIFIER
479
+ if (len < 1) return 'invalid length ' + len; // pgut001's dumpasn1.c enforces a minimum lenght of 3
477
480
  return this.stream.parseOID(content, content + len, maxLength);
478
481
  //case 0x07: // ObjectDescriptor
479
482
  //case 0x08: // EXTERNAL
package/defs.js CHANGED
@@ -140,4 +140,5 @@ Defs.commonTypes = [
140
140
  [ 'PKCS#10 certification request', '1.2.840.113549.1.10.1.1', 'CertificationRequest' ],
141
141
  [ 'CMP PKI Message', '1.3.6.1.5.5.7.0.16', 'PKIMessage' ],
142
142
  [ 'LDAP Message', '1.3.6.1.1.18', 'LDAPMessage' ],
143
+ [ 'Time Stamp Request', '1.3.6.1.5.5.7.0.13', 'TimeStampReq' ],
143
144
  ].map(arr => ({ description: arr[0], ...Defs.moduleAndType(rfcdef[arr[1]], arr[2]) }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lapo/asn1js",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Generic ASN.1 parser/decoder that can decode any valid ASN.1 DER or BER structures.",
5
5
  "type": "module",
6
6
  "main": "asn1.js",
@@ -48,14 +48,14 @@
48
48
  "packageManager": "pnpm@7.33.7",
49
49
  "devDependencies": {
50
50
  "@eslint/eslintrc": "^3.3.1",
51
- "@eslint/js": "^9.32.0",
52
- "@rollup/wasm-node": "^4.46.2",
51
+ "@eslint/js": "^9.38.0",
52
+ "@rollup/wasm-node": "^4.52.5",
53
53
  "diff": "^8.0.2",
54
- "eslint": "^9.32.0",
55
- "globals": "^16.3.0",
54
+ "eslint": "^9.38.0",
55
+ "globals": "^16.4.0",
56
56
  "htmlparser2": "^9.1.0",
57
- "vite": "^5.4.19",
58
- "vite-plugin-dom": "^1.0.4",
57
+ "vite": "^5.4.21",
58
+ "vite-plugin-dom": "^1.0.5",
59
59
  "vite-plugin-singlefile": "^2.3.0"
60
60
  },
61
61
  "overrides": {
@@ -63,7 +63,8 @@
63
63
  },
64
64
  "pnpm": {
65
65
  "overrides": {
66
- "rollup": "npm:@rollup/wasm-node"
66
+ "rollup": "npm:@rollup/wasm-node",
67
+ "esbuild@<=0.24.2": ">=0.25.0"
67
68
  }
68
69
  }
69
70
  }