@blamejs/pki 0.5.7 → 0.5.9
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 +418 -386
- package/MIGRATING.md +43 -0
- package/README.md +12 -12
- package/lib/acme.js +31 -31
- package/lib/asn1-der.js +10 -10
- package/lib/attrcert-sign.js +19 -19
- package/lib/byte-reader.js +6 -6
- package/lib/byte-writer.js +5 -5
- package/lib/cbor-det.js +27 -24
- package/lib/cmc-build.js +97 -92
- package/lib/cmc-verify.js +106 -30
- package/lib/cmp-build.js +25 -25
- package/lib/cmp-session.js +70 -70
- package/lib/cmp-verify.js +71 -57
- package/lib/cms-compress.js +7 -7
- package/lib/cms-decrypt.js +90 -72
- package/lib/cms-encrypt.js +32 -32
- package/lib/cms-sign.js +74 -55
- package/lib/cms-verify.js +97 -75
- package/lib/composite-sig.js +13 -13
- package/lib/constants.js +4 -4
- package/lib/crl-sign.js +22 -22
- package/lib/crl-verify.js +7 -6
- package/lib/crmf-sign.js +14 -14
- package/lib/csr-sign.js +8 -8
- package/lib/ct.js +37 -37
- package/lib/edwards-point.js +7 -7
- package/lib/est.js +98 -55
- package/lib/framework-error.js +5 -5
- package/lib/guard-all.js +5 -3
- package/lib/guard-async.js +4 -4
- package/lib/guard-bytes.js +79 -79
- package/lib/guard-compress.js +17 -17
- package/lib/guard-crypto.js +1 -1
- package/lib/guard-der.js +152 -0
- package/lib/guard-encoding.js +15 -15
- package/lib/guard-header.js +3 -3
- package/lib/guard-identifier.js +16 -16
- package/lib/guard-json.js +15 -15
- package/lib/guard-limits.js +7 -7
- package/lib/guard-name.js +81 -16
- package/lib/guard-parsed.js +80 -80
- package/lib/guard-range.js +19 -19
- package/lib/guard-secret.js +11 -10
- package/lib/guard-text.js +6 -6
- package/lib/guard-time.js +10 -10
- package/lib/hpke.js +18 -17
- package/lib/http-digest.js +35 -35
- package/lib/http-retry-after.js +13 -13
- package/lib/http-transport.js +20 -19
- package/lib/inspect.js +53 -53
- package/lib/ip-utils.js +2 -2
- package/lib/jose.js +13 -13
- package/lib/key.js +16 -16
- package/lib/lint.js +51 -51
- package/lib/merkle.js +51 -36
- package/lib/mime.js +18 -18
- package/lib/ocsp-verify.js +10 -10
- package/lib/ocsp.js +13 -13
- package/lib/oid.js +29 -29
- package/lib/path-validate.js +114 -113
- package/lib/pbes2.js +16 -16
- package/lib/pkcs12-build.js +53 -53
- package/lib/pki-build.js +48 -20
- package/lib/rc2.js +1 -1
- package/lib/rfc3339.js +5 -5
- package/lib/schema-all.js +31 -31
- package/lib/schema-attrcert.js +12 -12
- package/lib/schema-c509.js +149 -197
- package/lib/schema-cmc.js +58 -58
- package/lib/schema-cmp.js +43 -43
- package/lib/schema-cms.js +45 -45
- package/lib/schema-crl.js +7 -7
- package/lib/schema-crmf.js +28 -28
- package/lib/schema-csr.js +12 -12
- package/lib/schema-csrattrs.js +16 -16
- package/lib/schema-engine.js +18 -18
- package/lib/schema-ocsp.js +15 -15
- package/lib/schema-pkcs12.js +20 -20
- package/lib/schema-pkcs8.js +2 -2
- package/lib/schema-pkix.js +131 -126
- package/lib/schema-smime.js +19 -19
- package/lib/schema-tsp.js +12 -12
- package/lib/schema-x509.js +3 -3
- package/lib/shbs.js +18 -18
- package/lib/sign-scheme.js +13 -13
- package/lib/sigstore.js +10 -11
- package/lib/sleep.js +1 -1
- package/lib/smime.js +308 -96
- package/lib/tls-cert-compress.js +18 -18
- package/lib/trust.js +27 -27
- package/lib/tsp-sign.js +17 -17
- package/lib/validator-all.js +1 -1
- package/lib/validator-attcert.js +1 -1
- package/lib/validator-cose.js +43 -44
- package/lib/validator-keydesc.js +3 -3
- package/lib/validator-sig.js +13 -13
- package/lib/validator-tls.js +11 -11
- package/lib/validator-tpm.js +20 -19
- package/lib/webauthn-mds.js +66 -66
- package/lib/webauthn.js +33 -33
- package/lib/webcrypto.js +15 -15
- package/lib/x509-sign.js +13 -13
- package/package.json +3 -2
- package/sbom.cdx.json +6 -6
package/lib/ocsp.js
CHANGED
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
* (`pki.ocsp.verify`). Parsing lives in `pki.schema.ocsp`; revocation during path validation is
|
|
13
13
|
* `pki.path.ocspChecker`. Signing rides the shared sign-scheme registry (the same classical +
|
|
14
14
|
* post-quantum set `pki.cms.sign` uses), so a response is signed under RSA / ECDSA / EdDSA /
|
|
15
|
-
* ML-DSA / SLH-DSA per the responder key. Verification composes the
|
|
16
|
-
* authorization
|
|
15
|
+
* ML-DSA / SLH-DSA per the responder key. Verification composes the same hardened responder-
|
|
16
|
+
* authorization, signature and currency gates `pki.path.ocspChecker` runs; there is no weaker
|
|
17
17
|
* second verify path. Fail-closed: `verify` returns a `"unknown"` verdict (never a silent accept)
|
|
18
|
-
* for any unmet gate, with
|
|
18
|
+
* for any unmet gate, with one scoped exception: a request-nonce mismatch downgrades only a
|
|
19
19
|
* `good` to `"unknown"`, leaving a signed, current, authorized `revoked` reported as `revoked`
|
|
20
20
|
* with `nonceMatched: false` (see `verify`). Malformed input throws a typed `OcspError`.
|
|
21
21
|
* @spec RFC 6960, RFC 9654, RFC 5019
|
|
@@ -45,8 +45,8 @@ function _err(code, message, cause) { return new OcspError(code, message, cause)
|
|
|
45
45
|
function _signE(kind, message, cause) { return new OcspError("ocsp/" + kind, message, cause); }
|
|
46
46
|
|
|
47
47
|
// CertID / responder-ID hash algorithm name -> WebCrypto digest name. SHA-1 is the RFC 5019 interop
|
|
48
|
-
// default for the CertID
|
|
49
|
-
// lookup, so SHAttered does not bar it
|
|
48
|
+
// default for the CertID identity hash (not a signature; collision resistance is irrelevant to the
|
|
49
|
+
// lookup, so SHAttered does not bar it, the same deliberate split path-validate makes).
|
|
50
50
|
var HASH_WC = { sha1: "SHA-1", sha256: "SHA-256", sha384: "SHA-384", sha512: "SHA-512" };
|
|
51
51
|
// A CRLReason name -> its enumerated value (RFC 5280 sec. 5.3.1), reverse of pki.C.NAMES.CRL_REASON.
|
|
52
52
|
var REASON_CODE = {};
|
|
@@ -73,7 +73,7 @@ function _certOf(arg, what) {
|
|
|
73
73
|
// The response, always parsed from the bytes the caller handed over. See verify's own comment for
|
|
74
74
|
// why an object cannot be accepted here: the three parts of a signature check would come from three
|
|
75
75
|
// independently-chosen properties. The claim is detected on any of the parsed-response fields, so a
|
|
76
|
-
// caller who passes one is told what happened
|
|
76
|
+
// caller who passes one is told what happened, never given a byte-parse fault about its type.
|
|
77
77
|
var _RESPONSE_CLAIM = ["responseStatus", "basicResponse", "tbsResponseDataBytes"];
|
|
78
78
|
function _responseFromBytes(response) {
|
|
79
79
|
return guard.parsed.fromTrustedSource(response, "ocspResponse", _RESPONSE_CLAIM, function (bytes) {
|
|
@@ -132,11 +132,11 @@ function _buildCertID(cert, issuer, hashName) {
|
|
|
132
132
|
* `opts.pem` is set.
|
|
133
133
|
*
|
|
134
134
|
* @opts
|
|
135
|
-
* hashAlgorithm `"sha1"` (default) / `"sha256"` / `"sha384"` / `"sha512"
|
|
135
|
+
* hashAlgorithm `"sha1"` (default) / `"sha256"` / `"sha384"` / `"sha512"`; the CertID identity hash.
|
|
136
136
|
* nonce `true` for a fresh 32-octet CSPRNG nonce (RFC 9654), or a caller Buffer (1..128 octets).
|
|
137
137
|
* requestorName a Name (RDN array) placed in the [1] requestorName as a directoryName.
|
|
138
138
|
* signer `{ cert, key }` to sign the request (requires requestorName).
|
|
139
|
-
* profile `"lightweight"
|
|
139
|
+
* profile `"lightweight"`: one Request, SHA-1 CertID, nonce-only extensions (RFC 5019).
|
|
140
140
|
* pem emit a PEM `OCSP REQUEST` string instead of DER.
|
|
141
141
|
* @example
|
|
142
142
|
* var ca = await pki.key.generate("Ed25519");
|
|
@@ -238,7 +238,7 @@ function _normCertDer(cert, what) {
|
|
|
238
238
|
* responderID, an optional producedAt, and one or more per-certificate responses; `responder` is the
|
|
239
239
|
* `{ cert, key }` signing the response (the issuing CA directly, or a CA-issued delegate bearing
|
|
240
240
|
* id-kp-OCSPSigning + id-pkix-ocsp-nocheck). The signature is computed over the exact ResponseData
|
|
241
|
-
* DER (RFC 6960 sec. 4.2.1
|
|
241
|
+
* DER (RFC 6960 sec. 4.2.1: no CMS wrapper, no signed attributes). The responder certificate is
|
|
242
242
|
* embedded in `certs [0]` so a relying party can find it. Returns the response DER, or PEM.
|
|
243
243
|
*
|
|
244
244
|
* @opts
|
|
@@ -449,15 +449,15 @@ function buildErrorResponse(status) {
|
|
|
449
449
|
* an AUTHORIZED responder (the issuing CA directly, or a CA-issued delegate bearing id-kp-OCSPSigning
|
|
450
450
|
* + id-pkix-ocsp-nocheck), verifies the signature over `tbsResponseData`, matches the CertID triple
|
|
451
451
|
* to the target certificate under the CertID's own hashAlgorithm, checks currency
|
|
452
|
-
* (`thisUpdate`/`nextUpdate`), and
|
|
453
|
-
* nonce echoes it. This runs the
|
|
452
|
+
* (`thisUpdate`/`nextUpdate`), and, when `opts.requestNonce` is supplied, confirms the response
|
|
453
|
+
* nonce echoes it. This runs the same hardened gates `pki.path.ocspChecker` does. Fail-closed: an
|
|
454
454
|
* unauthorized, stale, or CertID-mismatched response is a `"unknown"` verdict (never a silent
|
|
455
455
|
* accept); a malformed response's parse fault surfaces as the parser's `ocsp/*` / `asn1/*`.
|
|
456
456
|
*
|
|
457
|
-
* The request-nonce check is reported, and downgrades `good`
|
|
457
|
+
* The request-nonce check is reported, and downgrades `good` alone. Every verdict carries
|
|
458
458
|
* `nonceMatched` (true / false / null when the client sent no nonce). An unmatched nonce turns a
|
|
459
459
|
* `good` into `"unknown"`, because a response that is not an answer to this request cannot be relied
|
|
460
|
-
* on to say the certificate is still fine. It does
|
|
460
|
+
* on to say the certificate is still fine. It does not touch `revoked`: revocation does not go stale
|
|
461
461
|
* the way non-revocation does, so discarding a signed, current, authorized `revoked` because it was
|
|
462
462
|
* replayed would hand a soft-failing caller the very certificate the responder refused. A replayed
|
|
463
463
|
* `revoked` is therefore reported as `revoked` with `nonceMatched: false`.
|
package/lib/oid.js
CHANGED
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
* OID strings and their human names, plus arc conversion and DER
|
|
14
14
|
* encode/decode convenience. Every algorithm, attribute type, and
|
|
15
15
|
* extension in PKI is named by an OID, and resolving them through one
|
|
16
|
-
* registry
|
|
17
|
-
* codebase
|
|
16
|
+
* registry, instead of scattering magic dotted strings across the
|
|
17
|
+
* codebase, is what lets a new algorithm be a data entry instead of a
|
|
18
18
|
* code change.
|
|
19
19
|
*
|
|
20
20
|
* The seed set is declared by FAMILY: an OID belongs to a class with a
|
|
21
|
-
* shared base arc (the "starting variable"
|
|
21
|
+
* shared base arc (the "starting variable": `2.5.4` for the RFC 5280
|
|
22
22
|
* attribute types, `2.5.29` for the extensions, `2.16.840.1.101.3.4` for
|
|
23
23
|
* the NIST algorithms), and each member names only its trailing arc. The
|
|
24
24
|
* full OID is derived from base + leaf at load, so the arc hierarchy that
|
|
@@ -48,7 +48,7 @@ function _oidError(c, m) { return new OidError(c, m); }
|
|
|
48
48
|
// trailing arc (number) or a short arc array for a multi-level leaf; the full
|
|
49
49
|
// arc is derived at load via base.concat(leaf). Declaring by family means no
|
|
50
50
|
// dotted-decimal OID literal appears in this source at all, and adding a
|
|
51
|
-
// member is one `name: leaf` line under its class
|
|
51
|
+
// member is one `name: leaf` line under its class, with no base to re-type.
|
|
52
52
|
var FAMILIES = {
|
|
53
53
|
// RFC 5280 attribute types.
|
|
54
54
|
attributeType: { base: [2, 5, 4], of: {
|
|
@@ -142,7 +142,7 @@ var FAMILIES = {
|
|
|
142
142
|
// The gaps are the specification's own: 12/13/14 (identityProof/popLinkRandom/popLinkWitness's
|
|
143
143
|
// superseded siblings are retained below where RFC 6402 kept them) and 20 are unassigned in
|
|
144
144
|
// RFC 5272 Appendix A. V2 forms exist because RFC 6402 replaced the originals to fix a hash
|
|
145
|
-
// agility gap
|
|
145
|
+
// agility gap. Both are registered, since a v1 message is still legal to receive.
|
|
146
146
|
idCmc: { base: [1, 3, 6, 1, 5, 5, 7, 7], of: {
|
|
147
147
|
"id-cmc-statusInfo": 1, "id-cmc-identification": 2, "id-cmc-identityProof": 3,
|
|
148
148
|
"id-cmc-dataReturn": 4, "id-cmc-transactionId": 5, "id-cmc-senderNonce": 6,
|
|
@@ -155,7 +155,7 @@ var FAMILIES = {
|
|
|
155
155
|
"id-cmc-authData": 27, "id-cmc-batchRequests": 28, "id-cmc-batchResponses": 29,
|
|
156
156
|
"id-cmc-publishCert": 30, "id-cmc-modCertTemplate": 31, "id-cmc-controlProcessed": 32,
|
|
157
157
|
// ---------------------------------------------------------------------
|
|
158
|
-
// 33 / 34
|
|
158
|
+
// 33 / 34: the specification assigns these two OIDs both ways, and no
|
|
159
159
|
// erratum resolves it. Counted across every place either document states an
|
|
160
160
|
// assignment, it is not an even split:
|
|
161
161
|
//
|
|
@@ -167,7 +167,7 @@ var FAMILIES = {
|
|
|
167
167
|
// rfc6402.txt:1228 / :1245 RFC 6402 Appendix A.1 (1988 module)
|
|
168
168
|
//
|
|
169
169
|
// identityProofV2 = 33, popLinkWitnessV2 = 34
|
|
170
|
-
// rfc6402.txt:1938 / :1949 RFC 6402 Appendix A.2 (2008 module)
|
|
170
|
+
// rfc6402.txt:1938 / :1949 RFC 6402 Appendix A.2 (2008 module) alone
|
|
171
171
|
//
|
|
172
172
|
// The rows below therefore follow the base specification's normative body
|
|
173
173
|
// text and its module, which RFC 6402's own 1988 module agrees with. The
|
|
@@ -202,7 +202,7 @@ var FAMILIES = {
|
|
|
202
202
|
cabfPolicy: { base: [2, 23, 140, 1], of: {
|
|
203
203
|
"ev-guidelines": 1, "domain-validated": [2, 1], "organization-validated": [2, 2], "individual-validated": [2, 3] } },
|
|
204
204
|
|
|
205
|
-
// id-cp-ipAddr-asNumber (RFC 3779 / RFC 8360) on the id-pkix 14 arc
|
|
205
|
+
// id-cp-ipAddr-asNumber (RFC 3779 / RFC 8360) on the id-pkix 14 arc: the RPKI resource-certificate
|
|
206
206
|
// policy OIDs (sec. 8.9 ints 7-8).
|
|
207
207
|
idCp: { base: [1, 3, 6, 1, 5, 5, 7, 14], of: { "id-cp-ipAddr-asNumber": 2, "id-cp-ipAddr-asNumber-v2": 3 } },
|
|
208
208
|
|
|
@@ -217,14 +217,14 @@ var FAMILIES = {
|
|
|
217
217
|
"id-rspRole-ds-tls-v2": 6, "id-rspRole-ds-tls": [0, 0, 2, 0],
|
|
218
218
|
"id-rspRole-ds-auth-v2": 7, "id-rspRole-ds-auth": [0, 0, 2, 1] } },
|
|
219
219
|
|
|
220
|
-
// id-qt policy qualifiers (RFC 5280 sec. 4.2.1.4) on the id-pkix 2 arc
|
|
220
|
+
// id-qt policy qualifiers (RFC 5280 sec. 4.2.1.4) on the id-pkix 2 arc, which is the C509 sec. 8.10 registry.
|
|
221
221
|
pkixQt: { base: [1, 3, 6, 1, 5, 5, 7, 2], of: { cps: 1, unotice: 2 } },
|
|
222
222
|
|
|
223
223
|
// OCSP (RFC 6960) on the id-pkix-ocsp arc (= id-ad-ocsp). id-pkix-ocsp-basic is
|
|
224
224
|
// the ResponseBytes.responseType this build decodes; id-pkix-ocsp-nonce (sec. 4.4.1)
|
|
225
225
|
// names the nonce extension; the remaining members name the other OCSP extensions
|
|
226
|
-
// (CRL references, acceptable-response-types,
|
|
227
|
-
// preferred-signature-algorithms, extended-revoke
|
|
226
|
+
// of RFC 6960 sec. 4.4 and RFC 9654 (CRL references, acceptable-response-types,
|
|
227
|
+
// archive-cutoff, service-locator, preferred-signature-algorithms, extended-revoke).
|
|
228
228
|
ocsp: { base: [1, 3, 6, 1, 5, 5, 7, 48, 1], of: {
|
|
229
229
|
ocspBasic: 1, ocspNonce: 2, ocspCrl: 3, ocspResponse: 4, ocspNoCheck: 5,
|
|
230
230
|
ocspArchiveCutoff: 6, ocspServiceLocator: 7, ocspPrefSigAlgs: 8, ocspExtendedRevoke: 9 } },
|
|
@@ -232,13 +232,13 @@ var FAMILIES = {
|
|
|
232
232
|
// CRMF (RFC 4211) registration controls (sec. 6) and registration info (sec. 7) on the
|
|
233
233
|
// id-pkip arc (id-pkix 5). id-regCtrl (id-pkip 1) names the control types a
|
|
234
234
|
// CertRequest carries; id-regInfo (id-pkip 2) names the registration-info types.
|
|
235
|
-
// The parser surfaces each control/info value
|
|
235
|
+
// The parser surfaces each control/info value raw, keyed by these names.
|
|
236
236
|
regCtrl: { base: [1, 3, 6, 1, 5, 5, 7, 5, 1], of: {
|
|
237
237
|
regToken: 1, authenticator: 2, pkiPublicationInfo: 3, pkiArchiveOptions: 4, oldCertID: 5, protocolEncrKey: 6 } },
|
|
238
238
|
regInfo: { base: [1, 3, 6, 1, 5, 5, 7, 5, 2], of: { utf8Pairs: 1, certReq: 2 } },
|
|
239
239
|
|
|
240
|
-
// PKIX extended key purposes (id-kp, RFC 5280 sec. 4.2.1.12). timeStamping is required
|
|
241
|
-
//
|
|
240
|
+
// PKIX extended key purposes (id-kp, RFC 5280 sec. 4.2.1.12). timeStamping is required,
|
|
241
|
+
// critical, and sole on an RFC 3161 TSA signing certificate (sec. 2.3). The SSH
|
|
242
242
|
// (RFC 6187), CMC (RFC 6402), and Bundle Security (RFC 9174) purposes complete the C509
|
|
243
243
|
// Extended Key Usages registry (draft-ietf-cose-cbor-encoded-cert sec. 8.12).
|
|
244
244
|
pkixKp: { base: [1, 3, 6, 1, 5, 5, 7, 3], of: {
|
|
@@ -255,14 +255,14 @@ var FAMILIES = {
|
|
|
255
255
|
// Google Certificate Transparency (RFC 6962) on the 1.3.6.1.4.1.11129.2.4 arc:
|
|
256
256
|
// the SCT-list X.509 extension (sec. 3.3), the precertificate poison (sec. 3.1), the
|
|
257
257
|
// precert-signing EKU (sec. 3.1, naming only), and the OCSP-delivered SCT list
|
|
258
|
-
// (sec. 3.3). The SCT payload itself is TLS presentation language,
|
|
259
|
-
//
|
|
258
|
+
// (sec. 3.3). The SCT payload itself is TLS presentation language, so it is parsed
|
|
259
|
+
// by lib/ct.js (pki.ct) and never routed through the DER schema engine.
|
|
260
260
|
ct: { base: [1, 3, 6, 1, 4, 1, 11129, 2, 4], of: {
|
|
261
261
|
signedCertificateTimestampList: 2, precertificatePoison: 3,
|
|
262
262
|
precertificateSigningCert: 4, ocspSignedCertificateTimestampList: 5 } },
|
|
263
263
|
|
|
264
264
|
// Fulcio (Sigstore) X.509 certificate-extension arc. `.1.1`-`.1.6` are the
|
|
265
|
-
// DEPRECATED members whose values are
|
|
265
|
+
// DEPRECATED members whose values are raw UTF-8 strings (no DER wrapping);
|
|
266
266
|
// `.1.7` is the OtherName SAN type; `.1.8` onward are DER-encoded ASN.1
|
|
267
267
|
// UTF8String -- the decode MUST honor the raw-vs-DER split by member.
|
|
268
268
|
fulcio: { base: [1, 3, 6, 1, 4, 1, 57264, 1], of: {
|
|
@@ -287,7 +287,7 @@ var FAMILIES = {
|
|
|
287
287
|
data: 1, signedData: 2, envelopedData: 3, signedAndEnvelopedData: 4,
|
|
288
288
|
digestedData: 5, encryptedData: 6 } },
|
|
289
289
|
|
|
290
|
-
// PKCS#9 attribute types
|
|
290
|
+
// PKCS#9 attribute types, including the CMS signed-attribute OIDs (RFC 5652 sec. 11)
|
|
291
291
|
// and the PKCS#12 bag attributes friendlyName / localKeyId (RFC 7292 sec. 4.2).
|
|
292
292
|
pkcs9: { base: [1, 2, 840, 113549, 1, 9], of: {
|
|
293
293
|
emailAddress: 1, contentType: 3, messageDigest: 4, signingTime: 5,
|
|
@@ -320,9 +320,9 @@ var FAMILIES = {
|
|
|
320
320
|
pkcs12BagTypes: { base: [1, 2, 840, 113549, 1, 12, 10, 1], of: {
|
|
321
321
|
keyBag: 1, pkcs8ShroudedKeyBag: 2, certBag: 3, crlBag: 4, secretBag: 5, safeContentsBag: 6 } },
|
|
322
322
|
|
|
323
|
-
// PKCS#12 password-based encryption schemes (RFC 7292 Appendix C)
|
|
324
|
-
// PBE identifiers still emitted by deployed exporters; recognized so
|
|
325
|
-
// shrouded bag's algorithm resolves to a name, never decrypted here.
|
|
323
|
+
// PKCS#12 password-based encryption schemes (RFC 7292 Appendix C). These legacy
|
|
324
|
+
// PBE identifiers are still emitted by deployed exporters; they are recognized so
|
|
325
|
+
// a shrouded bag's algorithm resolves to a name, never decrypted here.
|
|
326
326
|
pkcs12Pbe: { base: [1, 2, 840, 113549, 1, 12, 1], of: {
|
|
327
327
|
pbeWithSHAAnd128BitRC4: 1, pbeWithSHAAnd40BitRC4: 2,
|
|
328
328
|
"pbeWithSHAAnd3-KeyTripleDES-CBC": 3, "pbeWithSHAAnd2-KeyTripleDES-CBC": 4,
|
|
@@ -354,7 +354,7 @@ var FAMILIES = {
|
|
|
354
354
|
hkdfWithSha256: 28, hkdfWithSha384: 29, hkdfWithSha512: 30, cekHkdfSha256: 31 } },
|
|
355
355
|
|
|
356
356
|
// RFC 5753 ephemeral-static ECDH key-agreement schemes -- the keyEncryptionAlgorithm OID of a
|
|
357
|
-
// kari, whose PARAMETER is the KeyWrapAlgorithm (so these are
|
|
357
|
+
// kari, whose PARAMETER is the KeyWrapAlgorithm (so these are not params-absent). The X9.63 KDF
|
|
358
358
|
// variants: stdDH (SECG arc 1.3.132.1.11) + cofactorDH (1.3.132.1.14) for SHA-224/256/384/512,
|
|
359
359
|
// and the SHA-1 KDF pair on the ANSI-X9.63 arc (the OpenSSL default).
|
|
360
360
|
secgStdDH: { base: [1, 3, 132, 1, 11], of: {
|
|
@@ -371,9 +371,9 @@ var FAMILIES = {
|
|
|
371
371
|
// id-alg-hss-lms-hashsig OID above (RFC 9708 / RFC 9802 share it).
|
|
372
372
|
pkixAlg: { base: [1, 3, 6, 1, 5, 5, 7, 6], of: {
|
|
373
373
|
// id-alg-noSignature (RFC 6402 sec. 2.4, {id-pkix id-alg(6) 2}): the CMC
|
|
374
|
-
// "signature" algorithm for a request whose signer has no key yet
|
|
374
|
+
// "signature" algorithm for a request whose signer has no key yet; the
|
|
375
375
|
// SignerInfo carries a MAC-based proof instead. Registered so a decoder can
|
|
376
|
-
//
|
|
376
|
+
// name it and refuse it deliberately.
|
|
377
377
|
"id-alg-noSignature": 2,
|
|
378
378
|
"id-alg-xmss-hashsig": 34, "id-alg-xmssmt-hashsig": 35,
|
|
379
379
|
// Composite ML-DSA signature algorithms (draft-ietf-lamps-pq-composite-sigs
|
|
@@ -413,8 +413,8 @@ var FAMILIES = {
|
|
|
413
413
|
signingCertificate: 12, timeStampToken: 14, decryptKeyID: 37, signingCertificateV2: 47,
|
|
414
414
|
// id-aa-cmc-unsignedData (RFC 6402 sec. 2.7, {id-aa 34}): the CMC unsigned
|
|
415
415
|
// attribute that carries body parts too large to sit inside the signed
|
|
416
|
-
// PKIData
|
|
417
|
-
// untrusted data
|
|
416
|
+
// PKIData. It is unsigned by design, so a consumer must treat its contents
|
|
417
|
+
// as untrusted data.
|
|
418
418
|
cmcUnsignedData: 34,
|
|
419
419
|
asymmDecryptKeyID: 54, certificationRequestInfoTemplate: 61, extensionReqTemplate: 62 } },
|
|
420
420
|
|
|
@@ -538,7 +538,7 @@ function _assertEncodable(dotted, who) {
|
|
|
538
538
|
// X.660 encodability: the root arc is 0..2 and, under roots 0 and 1, the
|
|
539
539
|
// second arc is 0..39 (the first two arcs pack into a single octet as
|
|
540
540
|
// 40*X+Y). An OID outside these bounds can never be DER-encoded, so a
|
|
541
|
-
// registration carrying one fails at config time
|
|
541
|
+
// registration carrying one fails at config time, before anything tries to use it.
|
|
542
542
|
function _assertEncodableArcs(arcs, who) {
|
|
543
543
|
if (arcs.length < 2) {
|
|
544
544
|
throw new OidError("oid/bad-input", who + ": an OID must have at least 2 arcs");
|
|
@@ -616,8 +616,8 @@ function register(dotted, n) {
|
|
|
616
616
|
* (the starting variable a class of OIDs has in common) and `members` maps
|
|
617
617
|
* each name to its trailing arc -- a number, or a short arc array for a
|
|
618
618
|
* multi-level leaf. Each full OID is derived as `base` followed by the leaf,
|
|
619
|
-
* so a family is declared as its hierarchy
|
|
620
|
-
*
|
|
619
|
+
* so a family is declared as its hierarchy and no full path is re-spelled.
|
|
620
|
+
* This is the primitive the built-in seed set itself is built from.
|
|
621
621
|
*
|
|
622
622
|
* @opts
|
|
623
623
|
* base: number[], // the shared arc prefix, e.g. [1,3,6,1,4,1,99999]
|