JavaScript generic ASN.1 parser (mirror)

Compare changes

Choose any two refs to compare.

+37 -4
-1
.github/workflows/node.js.yml
··· 19 19 - name: Use pnpm 20 20 uses: pnpm/action-setup@v4 21 21 with: 22 - version: 7 23 22 run_install: false 24 23 - name: Use Node.js ${{ matrix.node-version }} 25 24 uses: actions/setup-node@v4
+2 -2
.vscode/settings.json
··· 1 1 { 2 2 "editor.insertSpaces": true, 3 3 "editor.tabSize": 8, 4 - "editor.indentSize": 2, 4 + "editor.indentSize": 4, 5 5 "editor.stickyScroll.enabled": true, 6 6 "explorer.excludeGitIgnore": true, 7 7 "files.eol": "\n", 8 8 "git.openRepositoryInParentFolders": "never" 9 - } 9 + }
+27
CHANGELOG.md
··· 1 + # ChangeLog 2 + 3 + ## 2.1.0 - 2025-08-03 4 + 5 + ### Changed 6 + 7 + - when fields are CHOICEs now both the field name and the choice name are shown (fixes GitHub #102) 8 + - upgrade minimum NodeJS version supported from 12.20.0 to 14.6.0 due to usage of ?. and ?? operators in defs.js (ECMAScript 2020); older code is still linted against ECMAScript 2015 for now 9 + 10 + ### Added 11 + 12 + - add tests to check expected decoding 13 + 14 + ## 2.0.6 - 2025-07-29 15 + 16 + ### Added 17 + 18 + - add proper support for standard Base64 (we previously only supported Base64url) (fixes GitHub #99) 19 + - improve test harness 20 + 21 + ## 2.0.5 - 2025-04-12 22 + 23 + ### Added 24 + 25 + - add `index-local.html` for local `file://` usage without needing a web server 26 + - add definitions support for `LDAPMessage` 27 + - #TODO continue producing old ChangeLog entries
+1
README.md
··· 105 105 - [dedicated domain](https://asn1js.eu/) 106 106 - [InDefero tracker](http://idf.lapo.it/p/asn1js/) 107 107 - [GitHub mirror](https://github.com/lapo-luchini/asn1js) 108 + - [ChangeLog on GitHub](https://github.com/lapo-luchini/asn1js/blob/trunk/CHANGELOG.md) 108 109 - [Ohloh code stats](https://www.openhub.net/p/asn1js)
+3
asn1.js
··· 461 461 } 462 462 switch (this.tag.tagNumber) { 463 463 case 0x01: // BOOLEAN 464 + if (len === 0) return 'invalid length 0'; 464 465 return (this.stream.get(content) === 0) ? 'false' : 'true'; 465 466 case 0x02: // INTEGER 467 + if (len === 0) return 'invalid length 0'; 466 468 return this.stream.parseInteger(content, content + len); 467 469 case 0x03: { // BIT_STRING 468 470 let d = recurse(this, 'parseBitString', maxLength); 469 471 return '(' + d.size + ' bit)\n' + d.str; 470 472 } 471 473 case 0x04: { // OCTET_STRING 474 + if (len === 0) return 'invalid length 0'; 472 475 let d = recurse(this, 'parseOctetString', maxLength); 473 476 return '(' + d.size + ' byte)\n' + d.str; 474 477 }
+1
index.html
··· 107 107 <li>previous versions on githack: <select id="tags"><option>[select tag]</option></select></li> 108 108 <li><a href="http://idf.lapo.it/p/asn1js/">InDefero tracker</a> (currently offline)</li> 109 109 <li><a href="https://github.com/lapo-luchini/asn1js">github mirror</a></li> 110 + <li><a href="https://github.com/lapo-luchini/asn1js/blob/trunk/CHANGELOG.md">ChangeLog on GitHub</a></li> 110 111 <li><a href="https://www.openhub.net/p/asn1js">OpenHub code stats</a></li> 111 112 </ul> 112 113 </div>
+1 -1
release.sh
··· 5 5 rfcdef.js test.js tags.js 6 6 index.html index.css index.js index-local.html 7 7 favicon.svg tree-icon-light.svg tree-icon-dark.svg 8 - README.md LICENSE 8 + README.md LICENSE CHANGELOG.md 9 9 updateOID.sh check.sh 10 10 examples 11 11 "
+2
tags.js
··· 1 1 export const tags = { 2 + "2.1.0": "2025-08-03", 3 + "2.0.6": "2025-07-28", 2 4 "2.0.5": "2025-04-12", 3 5 "2.0.4": "2024-05-08", 4 6 "2.0.3": "2024-05-06",