@blamejs/pki 0.6.54 → 0.7.0

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.
@@ -35,12 +35,13 @@
35
35
  *
36
36
  * All three registered algorithms (zlib, brotli and zstd) are implemented,
37
37
  * and each is offered only where the running Node can decompress it safely. A
38
- * decompressor must fault on a frame it could not finish; where one instead
39
- * returns a short result and reports the whole input consumed, a peer could cut
40
- * a frame's tail and have the receiver read a prefix as the whole message. Any
41
- * algorithm whose decompressor behaves that way is dropped at startup and is
42
- * then neither advertised nor accepted. On the current long-term-support Node
43
- * this leaves zlib and brotli.
38
+ * decompressor must fault on a frame it could not finish. At load each is
39
+ * handed a frame with its last two bytes cut, and one that returns anything at
40
+ * all rather than faulting is dropped, because a runtime that accepts a cut
41
+ * frame lets a peer strip a frame's tail and have the receiver read a prefix as
42
+ * the whole message. A dropped algorithm is then neither compressed to nor
43
+ * accepted. At the Node 24.21 engine floor all three qualify; on a runtime
44
+ * where one does not, it is dropped.
44
45
  *
45
46
  * @card
46
47
  * Encode and decode RFC 8879 TLS compressed certificate messages and the
@@ -1,4 +1,4 @@
1
1
  {
2
- "_comment": "Vendored dependencies — none currently. @blamejs/pki's cryptography runs entirely on Node's built-in node:crypto: the classical algorithm set (RSA, ECDSA, EdDSA, ECDH, AES, HMAC, HKDF, PBKDF2, the SHA family) AND the FIPS 203/204/205 post-quantum algorithms (ML-KEM, ML-DSA, SLH-DSA) via the platform OpenSSL 3.5 that the Node engine floor (>=24.19) ships. A built-in ships zero bytes and is OpenSSL-interoperable by construction, so no crypto bundle is vendored. A package is added here ONLY when a specific operation is confirmed missing from the engine floor; see lib/vendor/README.md for the policy.",
2
+ "_comment": "Vendored dependencies: none currently. @blamejs/pki's cryptography runs entirely on Node's built-in node:crypto: the classical algorithm set (RSA, ECDSA, EdDSA, ECDH, AES, HMAC, HKDF, PBKDF2, the SHA family) AND the FIPS 203/204/205 post-quantum algorithms (ML-KEM, ML-DSA, SLH-DSA) via the platform OpenSSL 3.5 that the Node engine floor (>=24.21) ships. A built-in ships zero bytes and is OpenSSL-interoperable by construction, so no crypto bundle is vendored. A package is added here ONLY when a specific operation is confirmed missing from the engine floor; see lib/vendor/README.md for the policy.",
3
3
  "packages": {}
4
4
  }
@@ -6,7 +6,7 @@ nothing. This directory holds only the manifest.
6
6
  ## Native-first crypto
7
7
 
8
8
  The toolkit's cryptography runs entirely on Node's built-in `node:crypto`. The
9
- engine floor (Node `>=24.19`) links OpenSSL 3.5, which provides:
9
+ engine floor (Node `>=24.21`) links OpenSSL 3.5, which provides:
10
10
 
11
11
  - the full classical set: RSA (PKCS#1 v1.5, PSS, OAEP), ECDSA, EdDSA
12
12
  (Ed25519/Ed448), ECDH including X25519 and X448, AES (GCM/CBC/CTR/KW), HMAC,
@@ -139,27 +139,35 @@ function _verifyMetadataBlob(blob, opts) {
139
139
  opts = opts || {};
140
140
  if (!_isPlainObject(opts)) throw _err("webauthn/bad-input", "opts must be an object");
141
141
  guard.identifier.assertKnownKeys(opts, _BLOB_OPTS, _err, "webauthn/bad-input", "opts has an unknown key ");
142
- var roots = opts.rootCertificates;
142
+ /** @internal Every option is read here, once, into a plain snapshot, and validation, the checks and
143
+ * the result all read that snapshot. An option reached through an accessor answers each read
144
+ * separately, so a baseline that answered absent where the rollback comparison runs and present
145
+ * where the result is built skipped the comparison and still reported a baseline as checked.
146
+ * Read as the rest of the file reads an option, `opts.<name>`, so an inherited one still counts. */
147
+ var o = guard.identifier.snapshotOptions(opts, _BLOB_OPTS);
148
+
149
+ var roots = o.rootCertificates;
143
150
  if (!Array.isArray(roots) || roots.length === 0) {
144
151
  throw _err("webauthn/metadata-no-root", "verifying a metadata BLOB requires opts.rootCertificates -- the FIDO root(s) to anchor it to; this library bundles none");
145
152
  }
146
- if (opts.time !== undefined) guard.time.assertValid(opts.time, _err, "webauthn/bad-input", "opts.time");
147
- var at = opts.time === undefined ? new Date() : opts.time;
148
- if (opts.previousNo !== undefined && (!Number.isSafeInteger(opts.previousNo) || opts.previousNo < 0)) {
153
+ if (o.time !== undefined) guard.time.assertValid(o.time, _err, "webauthn/bad-input", "opts.time");
154
+ var at = o.time === undefined ? new Date() : o.time;
155
+ if (o.previousNo !== undefined && (!Number.isSafeInteger(o.previousNo) || o.previousNo < 0)) {
149
156
  throw _err("webauthn/bad-input", "opts.previousNo must be a non-negative safe integer");
150
157
  }
151
158
  ["requireRollbackCheck", "allowStale", "rejectUnknownStatus"].forEach(function (k) {
152
- if (opts[k] !== undefined && typeof opts[k] !== "boolean") {
159
+ if (o[k] !== undefined && typeof o[k] !== "boolean") {
153
160
  throw _err("webauthn/bad-input", "opts." + k + " must be a boolean");
154
161
  }
155
162
  });
156
- if (opts.statusPolicy !== undefined && typeof opts.statusPolicy !== "function" &&
157
- opts.statusPolicy !== "any" && opts.statusPolicy !== "latest-by-date") {
163
+ if (o.statusPolicy !== undefined && typeof o.statusPolicy !== "function" &&
164
+ o.statusPolicy !== "any" && o.statusPolicy !== "latest-by-date") {
158
165
  throw _err("webauthn/bad-input", "opts.statusPolicy must be \"any\", \"latest-by-date\", or a function");
159
166
  }
160
- if (opts.requireRollbackCheck === true && opts.previousNo === undefined) {
167
+ if (o.requireRollbackCheck === true && o.previousNo === undefined) {
161
168
  throw _err("webauthn/metadata-no-baseline", "opts.requireRollbackCheck was set without opts.previousNo, so there is no baseline to compare against");
162
169
  }
170
+ opts = o;
163
171
  var anchors = roots.map(function (r, i) { return _asCert(r, "opts.rootCertificates[" + i + "]"); });
164
172
 
165
173
  var raw = guard.bytes.isByteSource(blob)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blamejs/pki",
3
- "version": "0.6.54",
3
+ "version": "0.7.0",
4
4
  "description": "Pure-JavaScript PKI toolkit that owns its stack — X.509, ASN.1/DER, CMS, PQC-first.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "blamejs contributors",
@@ -51,7 +51,7 @@
51
51
  "owns-its-stack"
52
52
  ],
53
53
  "engines": {
54
- "node": ">=24.19.0"
54
+ "node": ">=24.21.0"
55
55
  },
56
56
  "files": [
57
57
  "index.js",
@@ -68,7 +68,8 @@
68
68
  "test": "node test/smoke.js",
69
69
  "lint": "eslint --max-warnings 0 .",
70
70
  "fuzz": "npm ci --prefix fuzz && npx --prefix fuzz jazzer fuzz/asn1-der.fuzz.js -- -max_total_time=60",
71
- "gates": "node test/layer-0-primitives/codebase-patterns.test.js && node scripts/validate-source-comment-blocks.js && node scripts/check-api-snapshot.js && node scripts/check-spelling-consistency.js",
71
+ "gates": "node test/layer-0-primitives/codebase-patterns.test.js && node scripts/validate-source-comment-blocks.js && node scripts/check-api-snapshot.js && node scripts/check-spelling-consistency.js && node scripts/check-engine-floor.js",
72
+ "check:engine-floor": "node scripts/check-engine-floor.js",
72
73
  "check:spelling": "node scripts/check-spelling-consistency.js",
73
74
  "coverage": "c8 --include=lib/** --include=index.js --reporter=text-summary --reporter=lcov node test/smoke.js",
74
75
  "check:prose": "node scripts/check-operator-prose.js",
package/sbom.cdx.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "$schema": "http://cyclonedx.org/schema/bom-1.5.schema.json",
3
3
  "bomFormat": "CycloneDX",
4
4
  "specVersion": "1.5",
5
- "serialNumber": "urn:uuid:3fcb367d-0079-41f4-bd25-0141050006d7",
5
+ "serialNumber": "urn:uuid:fb4bc11f-cd39-480a-b276-ec20713541e7",
6
6
  "version": 1,
7
7
  "metadata": {
8
- "timestamp": "2026-09-07T18:01:28.536Z",
8
+ "timestamp": "2026-09-10T03:36:52.727Z",
9
9
  "lifecycles": [
10
10
  {
11
11
  "phase": "build"
@@ -15,18 +15,18 @@
15
15
  {
16
16
  "vendor": "npm",
17
17
  "name": "cli",
18
- "version": "11.17.0"
18
+ "version": "11.19.0"
19
19
  }
20
20
  ],
21
21
  "component": {
22
- "bom-ref": "@blamejs/pki@0.6.54",
22
+ "bom-ref": "@blamejs/pki@0.7.0",
23
23
  "type": "application",
24
24
  "name": "pki",
25
- "version": "0.6.54",
25
+ "version": "0.7.0",
26
26
  "scope": "required",
27
27
  "author": "blamejs contributors",
28
28
  "description": "Pure-JavaScript PKI toolkit that owns its stack — X.509, ASN.1/DER, CMS, PQC-first.",
29
- "purl": "pkg:npm/%40blamejs/pki@0.6.54",
29
+ "purl": "pkg:npm/%40blamejs/pki@0.7.0",
30
30
  "properties": [],
31
31
  "externalReferences": [
32
32
  {
@@ -54,7 +54,7 @@
54
54
  "components": [],
55
55
  "dependencies": [
56
56
  {
57
- "ref": "@blamejs/pki@0.6.54",
57
+ "ref": "@blamejs/pki@0.7.0",
58
58
  "dependsOn": []
59
59
  }
60
60
  ]