@blamejs/pki 0.6.55 → 0.7.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/CHANGELOG.md +41 -0
- package/README.md +2 -2
- package/lib/guard-identifier.js +10 -0
- package/lib/path-validate.js +24 -5
- package/lib/sigstore.js +722 -97
- package/lib/tls-cert-compress.js +7 -6
- package/lib/vendor/MANIFEST.json +1 -1
- package/lib/vendor/README.md +1 -1
- package/lib/webauthn-mds.js +16 -8
- package/package.json +4 -3
- package/sbom.cdx.json +7 -7
package/lib/tls-cert-compress.js
CHANGED
|
@@ -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
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
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
|
package/lib/vendor/MANIFEST.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_comment": "Vendored dependencies
|
|
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
|
}
|
package/lib/vendor/README.md
CHANGED
|
@@ -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.
|
|
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,
|
package/lib/webauthn-mds.js
CHANGED
|
@@ -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
|
-
|
|
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 (
|
|
147
|
-
var at =
|
|
148
|
-
if (
|
|
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 (
|
|
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 (
|
|
157
|
-
|
|
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 (
|
|
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.
|
|
3
|
+
"version": "0.7.1",
|
|
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.
|
|
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:
|
|
5
|
+
"serialNumber": "urn:uuid:f4cef9a3-338a-48f8-81a2-c156e38dfb4b",
|
|
6
6
|
"version": 1,
|
|
7
7
|
"metadata": {
|
|
8
|
-
"timestamp": "2026-09-
|
|
8
|
+
"timestamp": "2026-09-10T05:54:34.594Z",
|
|
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.
|
|
18
|
+
"version": "11.19.0"
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"component": {
|
|
22
|
-
"bom-ref": "@blamejs/pki@0.
|
|
22
|
+
"bom-ref": "@blamejs/pki@0.7.1",
|
|
23
23
|
"type": "application",
|
|
24
24
|
"name": "pki",
|
|
25
|
-
"version": "0.
|
|
25
|
+
"version": "0.7.1",
|
|
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.
|
|
29
|
+
"purl": "pkg:npm/%40blamejs/pki@0.7.1",
|
|
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.
|
|
57
|
+
"ref": "@blamejs/pki@0.7.1",
|
|
58
58
|
"dependsOn": []
|
|
59
59
|
}
|
|
60
60
|
]
|