@blamejs/pki 0.6.27 → 0.6.28
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 +8 -0
- package/lib/guard-limits.js +1 -0
- package/lib/path-validate.js +7 -1
- package/package.json +1 -1
- package/sbom.cdx.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ All notable changes to `@blamejs/pki` are documented here. The format
|
|
|
4
4
|
follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); this
|
|
5
5
|
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## v0.6.28 — 2026-09-02
|
|
8
|
+
|
|
9
|
+
pki.path.build returns the best accepted path when the candidate cap is reached during policy ranking, instead of discarding it.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- pki.path.build with userInitialPolicySet no longer throws path/build-limit after it has already accepted a valid path. When the candidate cap is reached during policy ranking, it returns the best-policy accepted path (forward and reverse directions), and candidatesConsidered reflects the full expansion count. It throws path/build-limit only when no valid path was accepted before the cap. This restores the pre-0.6.26 behavior for a policy set that no single path fully covers under a bounded search.
|
|
14
|
+
|
|
7
15
|
## v0.6.27 — 2026-09-02
|
|
8
16
|
|
|
9
17
|
The SCEP client can reach a CA through a forward proxy, with Basic authentication over an https proxy.
|
package/lib/guard-limits.js
CHANGED
package/lib/path-validate.js
CHANGED
|
@@ -2305,7 +2305,7 @@ async function _fetchAiaIssuers(current, aia) {
|
|
|
2305
2305
|
* @opts maxAiaPerCert Cap on caIssuers URLs tried per certificate (default `C.LIMITS.PATH_AIA_MAX_PER_CERT`).
|
|
2306
2306
|
* @opts aiaTimeout Per-fetch timeout in ms, forwarded to the transport.
|
|
2307
2307
|
* @opts maxResponseBytes Per-fetch response size cap, forwarded to the transport (tightenable downward only).
|
|
2308
|
-
* @opts (validate options) Every `pki.path.validate` option (`requiredEku`, `revocationChecker`, `checkPurpose`, the initial policy inputs, ...) is forwarded unchanged. When `userInitialPolicySet` is supplied, build returns the accepted path whose user-constrained policy set best satisfies it (RFC 4158 sec. 4 forward policy chaining) rather than the first accepted path; `validate` still gates every path, so this changes only which valid path is chosen. The ranking explores more of the candidate graph than a first-accept build, so it is bounded by `maxCandidatesConsidered` like the rest of the search: a
|
|
2308
|
+
* @opts (validate options) Every `pki.path.validate` option (`requiredEku`, `revocationChecker`, `checkPurpose`, the initial policy inputs, ...) is forwarded unchanged. When `userInitialPolicySet` is supplied, build returns the accepted path whose user-constrained policy set best satisfies it (RFC 4158 sec. 4 forward policy chaining) rather than the first accepted path; `validate` still gates every path, so this changes only which valid path is chosen. The ranking explores more of the candidate graph than a first-accept build, so it is bounded by `maxCandidatesConsidered` like the rest of the search. Reaching that cap means stop looking, not nothing found: if a valid path was already accepted, build returns the best-policy one of those; it reaches `path/build-limit` only when the cap is hit before any valid path is accepted. An `anyPolicy` entry makes the set unconstrained, so ranking is skipped and the first accepted path is returned.
|
|
2309
2309
|
* @example
|
|
2310
2310
|
* var pair = await pki.key.generate("Ed25519");
|
|
2311
2311
|
* var pemString = await pki.x509.sign({ subject: "Example Root", subjectPublicKey: await pki.key.export(pair.publicKey),
|
|
@@ -2424,6 +2424,7 @@ async function build(leaf, opts) {
|
|
|
2424
2424
|
}
|
|
2425
2425
|
var accepted = selectByPolicy ? [] : null;
|
|
2426
2426
|
|
|
2427
|
+
try {
|
|
2427
2428
|
if (direction === "reverse") {
|
|
2428
2429
|
var rstack = [];
|
|
2429
2430
|
for (var rsi = 0; rsi < anchors.length; rsi++) intrinsic.push(rstack, { chain: [], hop: 0, keys: new Set([identityKey(leafCert)]), anchor: anchors[rsi] });
|
|
@@ -2523,6 +2524,11 @@ async function build(leaf, opts) {
|
|
|
2523
2524
|
considered += _pushCandidates(frame, scored, stack, counter);
|
|
2524
2525
|
}
|
|
2525
2526
|
}
|
|
2527
|
+
} catch (_limitErr) {
|
|
2528
|
+
// allow:swallow-unverified the candidate cap means "stop looking", not "nothing found": once a valid path has
|
|
2529
|
+
if (!(selectByPolicy && accepted && accepted.length && _limitErr && _limitErr.code === "path/build-limit")) throw _limitErr;
|
|
2530
|
+
considered = counter.count();
|
|
2531
|
+
}
|
|
2526
2532
|
|
|
2527
2533
|
if (selectByPolicy && !success && accepted.length) success = _bestByPolicy(accepted, uipsDistinct);
|
|
2528
2534
|
|
package/package.json
CHANGED
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:74721cd1-1687-4508-a102-a5ca6b30f23d",
|
|
6
6
|
"version": 1,
|
|
7
7
|
"metadata": {
|
|
8
|
-
"timestamp": "2026-09-
|
|
8
|
+
"timestamp": "2026-09-02T21:18:19.420Z",
|
|
9
9
|
"lifecycles": [
|
|
10
10
|
{
|
|
11
11
|
"phase": "build"
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
}
|
|
20
20
|
],
|
|
21
21
|
"component": {
|
|
22
|
-
"bom-ref": "@blamejs/pki@0.6.
|
|
22
|
+
"bom-ref": "@blamejs/pki@0.6.28",
|
|
23
23
|
"type": "application",
|
|
24
24
|
"name": "pki",
|
|
25
|
-
"version": "0.6.
|
|
25
|
+
"version": "0.6.28",
|
|
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.
|
|
29
|
+
"purl": "pkg:npm/%40blamejs/pki@0.6.28",
|
|
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.
|
|
57
|
+
"ref": "@blamejs/pki@0.6.28",
|
|
58
58
|
"dependsOn": []
|
|
59
59
|
}
|
|
60
60
|
]
|