@blamejs/pki 0.5.29 → 0.5.30
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/cmp-session.js +14 -5
- package/lib/oid.js +24 -0
- 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.5.30 — 2026-08-24
|
|
8
|
+
|
|
9
|
+
A CMP certReqTemplate keySpec that names an ISO/IEC 9796-2 RSA signature scheme is now refused, instead of being surfaced to the caller as a non-RSA algorithm requirement.
|
|
10
|
+
|
|
11
|
+
### Security
|
|
12
|
+
|
|
13
|
+
- `pki.cmp.session` refuses a certReqTemplate keySpec whose `id-regCtrl-algId` names an ISO/IEC 9796-2 RSA signature-with-message-recovery scheme, with `cmp/bad-info-value`, rather than surfacing it to the caller as a non-RSA algorithm requirement. RFC 9483 sec. 4.3.3 reserves an RSA key requirement for `id-regCtrl-rsaKeyLen`; the 9796-2 schemes are RSA, so a keySpec naming one is now rejected the same way an rsaEncryption or RSASSA-PSS algId already was. The classifier recognizes the deterministic (1.3.36.3.4.2) and randomized (1.3.36.3.4.3) sub-arcs by prefix -- so a hash variant registered later is caught without being listed -- and ISO/IEC 9796-1 (1.3.36.3.4.1) on the same registrant arc. The generic signatureScheme parent (1.3.36.3.4) and the sibling authentication arc (1.3.36.3.5, whose children include ECC) are not treated as RSA, so a non-RSA algorithm under either is still surfaced. Recognizing these OIDs classifies a keySpec requirement; it is not a claim that the toolkit produces or verifies a 9796-2 signature.
|
|
14
|
+
|
|
7
15
|
## v0.5.29 — 2026-08-24
|
|
8
16
|
|
|
9
17
|
pki.path.validate refuses a mis-shaped trust anchor instead of returning a verdict against it, and accepts a parsed certificate directly.
|
package/lib/cmp-session.js
CHANGED
|
@@ -135,10 +135,15 @@ var KNOWN_REVOKE_KEYS = { certificate: 1, certDetails: 1, reason: 1 };
|
|
|
135
135
|
// "RSA" is decided by OID FAMILY, not a hand-list. An RSA-DEDICATED arc -- one whose members are RSA --
|
|
136
136
|
// is matched by its prefix, so a standardized member this registry has not named is caught with the ones
|
|
137
137
|
// it has: PKCS#1 (rsaEncryption, PSS, OAEP, every sha*/md*WithRSAEncryption), the TeleTrusT rsaSignature
|
|
138
|
-
// arc (RSA with SHA-1 and the RIPEMD family),
|
|
139
|
-
//
|
|
140
|
-
//
|
|
141
|
-
//
|
|
138
|
+
// arc (RSA with SHA-1 and the RIPEMD family), the TeleTrusT signatureScheme arc (the ISO/IEC 9796-2 RSA
|
|
139
|
+
// signature-with-message-recovery schemes -- deterministic 1.3.36.3.4.2 and randomized .4.3 -- plus ISO/IEC
|
|
140
|
+
// 9796-1 on .4.1), and the BSI TR-03110 id-TA-RSA arc (EAC Terminal Authentication, RSA v1.5/PSS over
|
|
141
|
+
// SHA-1/256/512). Each prefix is the arc a registered member sits directly under, read from the registry,
|
|
142
|
+
// so no dotted-decimal literal appears here and pki.oid.register cannot move it. The strict-descendant
|
|
143
|
+
// match skips an arc NODE itself, so a scheme's bare arc node (the 9796 1.3.36.3.4.1/.2/.3 nodes) is named
|
|
144
|
+
// off-arc below; the generic signatureScheme PARENT (1.3.36.3.4) and the sibling authentication arc
|
|
145
|
+
// (1.3.36.3.5, whose .5.3 children are ECC) are NOT RSA-dedicated, so neither is prefix-matched. The PKCS#1
|
|
146
|
+
// arc also carries two auxiliary identifiers that are NOT RSA algorithms --
|
|
142
147
|
// mgf1 and pSpecified, the mask-generation and OAEP-label parameters -- so those are excluded from the
|
|
143
148
|
// match by name (RSA_ARC_EXCLUDE) and surfaced. RSA also sits off those arcs on ones it SHARES with non-RSA
|
|
144
149
|
// algorithms, where no prefix can isolate it, so those are listed by name: id-rsa-kem (S/MIME) and
|
|
@@ -151,7 +156,8 @@ var KNOWN_REVOKE_KEYS = { certificate: 1, certDetails: 1, reason: 1 };
|
|
|
151
156
|
// Chinese GM/T sm3WithRSAEncryption (1.2.156.10197.1.504), an RSA-over-SM3 signature on the SM arc it
|
|
152
157
|
// shares with SM2 and SM3. A composite signature naming RSA as one half is a composite key, not an RSA
|
|
153
158
|
// one, and lives on the PKIX arc, so it is outside all of these.
|
|
154
|
-
var RSA_ARCS = ["rsaEncryption", "rsaSignatureWithripemd160", "id-TA-RSA-v1-5-SHA-256"
|
|
159
|
+
var RSA_ARCS = ["rsaEncryption", "rsaSignatureWithripemd160", "id-TA-RSA-v1-5-SHA-256",
|
|
160
|
+
"sigS-ISO9796-1-DFUE", "sigS-ISO9796-2Withrsa", "sigS-ISO9796-2rndWithrsa"].map(function (n) {
|
|
155
161
|
return oid.toArcs(oid.byName(n)).slice(0, -1); // the RSA-dedicated arc a registered member sits directly under
|
|
156
162
|
});
|
|
157
163
|
var RSA_OFF_ARC = Object.create(null);
|
|
@@ -165,6 +171,9 @@ var RSA_OFF_ARC = Object.create(null);
|
|
|
165
171
|
"rsa", // the X.509 directory rsa public-key OID (2.5.8.1.1), distinct from PKCS#1 rsaEncryption
|
|
166
172
|
"sqMod-nWithRSA", "mdc2WithRSA", // the X.500 directory signatureAlgorithm RSA OIDs (2.5.8.3.1, 2.5.8.3.100)
|
|
167
173
|
"sm3WithRSAEncryption", // the Chinese GM/T RSA-with-SM3 signature (1.2.156.10197.1.504)
|
|
174
|
+
// The TeleTrusT signatureScheme (ISO/IEC 9796-2) sub-arcs are prefix-matched in RSA_ARCS, but the strict-
|
|
175
|
+
// descendant match skips each arc NODE itself, so the three bare nodes are named here (1.3.36.3.4.1/.2/.3).
|
|
176
|
+
"sigS-ISO9796-1", "sigS-ISO9796-2", "sigS-ISO9796-2rnd",
|
|
168
177
|
].forEach(function (n) { var d = oid.byName(n); if (d) RSA_OFF_ARC[d] = 1; });
|
|
169
178
|
// The PKCS#1 arc carries two identifiers that are NOT RSA algorithms: mgf1 (the mask-generation function
|
|
170
179
|
// RSA-PSS and RSA-OAEP parametrize) and pSpecified (the OAEP label source). The prefix match would sweep
|
package/lib/oid.js
CHANGED
|
@@ -456,6 +456,30 @@ var FAMILIES = {
|
|
|
456
456
|
// registered here so that prefix can be derived from the registry rather than a dotted-decimal literal.
|
|
457
457
|
teletrustRsaSig: { base: [1, 3, 36, 3, 3, 1], of: { "rsaSignatureWithripemd160": 2 } },
|
|
458
458
|
|
|
459
|
+
// TeleTrusT (BSI) signatureScheme arc (1.3.36.3.4) -- the ISO/IEC 9796-2 RSA signatures giving message
|
|
460
|
+
// recovery (schemes 1/2/3: two deterministic, one randomized). ISO/IEC 9796-2 is titled "integer
|
|
461
|
+
// factorization based mechanisms", so EVERY scheme it defines is RSA and the standard has no non-RSA
|
|
462
|
+
// member; each node is registered so a consumer can name it -- e.g. the CMP keySpec RSA exclusion, which
|
|
463
|
+
// must recognize RSA wherever it is standardized. ISO/IEC 9796-2 assigns no algorithm OIDs of its own;
|
|
464
|
+
// this registrant tree is the de-facto registry. The .2 (deterministic) and .3 (randomized) sub-arcs are
|
|
465
|
+
// RSA-dedicated in full -- every descendant is RSA -- so a consumer prefix-matches each to catch a hash
|
|
466
|
+
// variant added later; the per-hash leaves are registered for readability. The `...Withrsa-even-exp`
|
|
467
|
+
// nodes (.2.1 / .3.1) are the even-public-exponent RSA variants the registrant marks "not used"; they are
|
|
468
|
+
// RSA (the registrant names them `sigS_ISO9796-2Withrsa_even-exp`), so the sub-arc prefix classifies them
|
|
469
|
+
// correctly, not wrongly. .1 is ISO/IEC 9796-1, also RSA, on the same arc. The PARENT node (.4) is generic
|
|
470
|
+
// "signatureScheme" and the sibling authentication arc (.5) is mixed (its .5.3 children are ECC), so
|
|
471
|
+
// neither is RSA-dedicated -- a consumer must not prefix-match the parent or .5.
|
|
472
|
+
teletrustSigScheme: { base: [1, 3, 36, 3, 4], of: {
|
|
473
|
+
"sigS-ISO9796-1": 1, "sigS-ISO9796-1-DFUE": [1, 1],
|
|
474
|
+
"sigS-ISO9796-2": 2, "sigS-ISO9796-2Withrsa-even-exp": [2, 1], "sigS-ISO9796-2Withrsa": [2, 2],
|
|
475
|
+
"sigS-ISO9796-2Withrsa-sha1": [2, 2, 1], "sigS-ISO9796-2Withrsa-ripemd160": [2, 2, 2],
|
|
476
|
+
"sigS-ISO9796-2Withrsa-sha224": [2, 2, 3], "sigS-ISO9796-2Withrsa-sha256": [2, 2, 4],
|
|
477
|
+
"sigS-ISO9796-2Withrsa-sha384": [2, 2, 5], "sigS-ISO9796-2Withrsa-sha512": [2, 2, 6],
|
|
478
|
+
"sigS-ISO9796-2rnd": 3, "sigS-ISO9796-2rndWithrsa-even-exp": [3, 1], "sigS-ISO9796-2rndWithrsa": [3, 2],
|
|
479
|
+
"sigS-ISO9796-2rndWithrsa-sha1": [3, 2, 1], "sigS-ISO9796-2rndWithrsa-ripemd160": [3, 2, 2],
|
|
480
|
+
"sigS-ISO9796-2rndWithrsa-sha224": [3, 2, 3], "sigS-ISO9796-2rndWithrsa-sha256": [3, 2, 4],
|
|
481
|
+
"sigS-ISO9796-2rndWithrsa-sha384": [3, 2, 5], "sigS-ISO9796-2rndWithrsa-sha512": [3, 2, 6] } },
|
|
482
|
+
|
|
459
483
|
// X.509 directory encryptionAlgorithm arc (2.5.8.1). id-ea-rsa (.1) is the X.509 `rsa` public-key
|
|
460
484
|
// identifier, distinct from PKCS#1 rsaEncryption. Registered so a consumer can name it -- e.g. the
|
|
461
485
|
// CMP keySpec RSA exclusion, which must recognize RSA wherever it is standardized.
|
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:a82d39df-dc02-419e-86bb-787363fa4d07",
|
|
6
6
|
"version": 1,
|
|
7
7
|
"metadata": {
|
|
8
|
-
"timestamp": "2026-08-
|
|
8
|
+
"timestamp": "2026-08-24T19:49:42.857Z",
|
|
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.5.
|
|
22
|
+
"bom-ref": "@blamejs/pki@0.5.30",
|
|
23
23
|
"type": "application",
|
|
24
24
|
"name": "pki",
|
|
25
|
-
"version": "0.5.
|
|
25
|
+
"version": "0.5.30",
|
|
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.5.
|
|
29
|
+
"purl": "pkg:npm/%40blamejs/pki@0.5.30",
|
|
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.5.
|
|
57
|
+
"ref": "@blamejs/pki@0.5.30",
|
|
58
58
|
"dependsOn": []
|
|
59
59
|
}
|
|
60
60
|
]
|