@blamejs/pki 0.5.34 → 0.5.35
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 +13 -0
- package/README.md +1 -1
- package/lib/cmp-build.js +46 -8
- package/lib/cms-sign.js +2 -2
- package/lib/guard-bytes.js +37 -12
- package/lib/pki-build.js +30 -1
- package/package.json +1 -1
- package/sbom.cdx.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,19 @@ 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.35 — 2026-08-29
|
|
8
|
+
|
|
9
|
+
pki.cmp.build now assembles the nested PKIMessage body an RA uses to forward or batch complete messages.
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `pki.cmp.build` accepts a `nested` body: `{ body: { nested: [pkiMessageDer, ...] } }` wraps an array of complete PKIMessage DER as a `NestedMessageContent` under the explicit `[20]` PKIBody tag (RFC 9810 sec. 5.1.3.5). This is the body a registration authority sends when it forwards or batches messages that were protected by other parties. Each entry is checked to parse as a PKIMessage and is then wrapped byte-for-byte unchanged, so a byte string that is not a PKIMessage is refused. An empty array is refused, because the field is `SIZE (1..MAX)`. Both failures raise `cmp/bad-input`. Following the same section, the inner messages are forwarded unchanged: each keeps its own protection, which the recipient validates, and `pki.cmp.build` does not re-sign, re-verify, or deeply inspect their contents.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- A caller array passed where a list of complete items is required is now refused with a typed error unless every position from 0 to its length is the array's own element. `pki.cms.sign` (the signer list) and `pki.cmp.build` (the `nested` message list) previously reached a native `TypeError` for a sparse array such as `new Array(2)`, or one carrying an empty slot or a `null` entry. An entry resolvable only through the array's prototype, including a polluted `Array.prototype` index, was worse: the entry deep-copy materialized it and the value was signed as though the caller had supplied it. The deep-copy now copies own array indices only, so a hole stays a hole, and a dense-array check refuses the list with `cms/bad-input` or `cmp/bad-input`, failing fast so a large sparse length cannot force a long traversal.
|
|
18
|
+
- A PEM-armored byte source passed to `pki.cmp.build` where DER is required is now refused with a typed error up front. Every field that takes a DER value the builder both validates with a parser and embeds verbatim is covered: the `nested` message list, the `p10cr` request, the signer certificate (`opts.cert`) and `opts.extraCerts`, and an embedded certificate or CRL. Because the parsers accept a PEM string, a PEM-armored `Buffer` (a file read straight from disk) passed validation but was embedded as ASCII armor, so the message was rejected only later, by its own parse, as `cmp/bad-der`, and for the signer certificate only after the private-key operation. The builder now requires a DER SEQUENCE for these fields, so a PEM or non-DER input fails immediately with a clear code and the bytes checked are the bytes embedded.
|
|
19
|
+
|
|
7
20
|
## v0.5.34 — 2026-08-29
|
|
8
21
|
|
|
9
22
|
A subjectAltName URI shorthand whose authority is a bracketed IPv6 literal is now accepted rather than refused.
|
package/README.md
CHANGED
|
@@ -233,7 +233,7 @@ comment blocks, is at [pkijs.com](https://pkijs.com).
|
|
|
233
233
|
| `pki.csr` | PKCS#10 certification-request issuance (RFC 2986 / RFC 2985). `sign(spec, key, opts)` builds and signs a `CertificationRequest` from a `spec` of subject (which may be empty), the public key being certified, an optional `extensionRequest` carrying the requested v3 extensions a CA copies into the issued certificate (subject alternative names, key usage, extended key usage, basic constraints, certificate policies, subject key identifier, or an array of pre-encoded Extension DER), and an optional `challengePassword`. `key` (or `{ key }`) is the subject's own private key: the request is self-signed to prove possession of the private half of `subjectPublicKey`, and that proof is verified before the request is returned, which is what `openssl req -verify` checks. The signature algorithm is resolved from the subject key, so RSA (PKCS#1 v1.5 or PSS via `opts.pss`), ECDSA, EdDSA, ML-DSA, SLH-DSA, and the composite arms all sign without a per-algorithm branch. Returns DER, or a PEM `CERTIFICATE REQUEST` with `opts.pem`; malformed input throws a typed `CsrError`. `verify(request)` asks the same question of a request someone else produced, over its exact signed `certificationRequestInfo` bytes under the `subjectPKInfo` inside them, through the one path-validation signature engine. It answers `{ verified, subject, subjectPublicKeyInfo, attributes, certificationRequestInfoBytes }`, all re-derived from the signed bytes, so a CA issues from the fields the signature covers rather than from the object it passed in. A `verified: true` says the producer held that private key and that the subject and requested extensions are the ones they signed; who they are is the enrollment protocol's question, not this one. Parsing stays at `pki.schema.csr.parse` — `sign`, `verify` |
|
|
234
234
|
| `pki.attrcert` | Attribute-certificate issuance (RFC 5755). `sign(spec, issuer, opts)` builds and signs an `AttributeCertificate` as an Attribute Authority: a `spec` of `holder` (exactly one of an entity name, a `baseCertificateID` reference, a `fromCertificate` binding, or an object digest), the validity window as GeneralizedTime, an optional serial (positive, at most 20 octets, randomly generated when omitted), the `attributes` (role, clearance, group, chargingIdentity, accessIdentity, authenticationInfo, or pre-encoded Attribute DER), and optional `extensions` (auditIdentity, targetInformation, noRevAvail, aaControls, acProxying, authorityKeyIdentifier, or pre-encoded Extension DER) each with its RFC 5755 criticality. An attribute certificate is never self-signed, so the `issuer` is the signing AA, supplied as `{ cert, key }` or `{ name, publicKey, key }`. The signature algorithm is resolved from the AA key, so RSA (PKCS#1 v1.5 or PSS via `opts.pss`), ECDSA, EdDSA, ML-DSA, SLH-DSA, and the composite arms all sign without a per-algorithm branch, and the signature is verified under the AA public key before the certificate is returned. Returns DER, or a PEM `ATTRIBUTE CERTIFICATE` with `opts.pem`; malformed input throws a typed `AttrCertError`. `verify(ac, issuer, opts)` is the receiving side, performing the RFC 5755 sec. 5 checks an attribute certificate and a named issuer can settle between them: the signature over the exact `AttributeCertificateInfo` bytes through the one path-validation signature engine, the AC naming the issuer this verifier trusts (compared as a distinguished name), the evaluation instant lying within the validity with equality at either bound succeeding as the section states, the sec. 4.3.2 targeting rule, and rejection of any critical extension this verb does not process (section 5 defines support as parsing the value AND rejecting where the value would reject, so `aaControls` and `acProxying`, whose constraints it does not evaluate, are refused when critical). It answers `{ verified, signatureValid, validityChecked, targetingChecked, holderBindingChecked, issuerPathChecked, holder, issuer, attributes, extensions, notBefore, notAfter, serialNumberHex, reason }` with the fields re-derived from the signed bytes; the holder's own certificate chain and the AC issuer's chain need certificates the verb is not given, so those slots report `false` rather than letting their absence read as a pass. Parsing stays at `pki.schema.attrcert.parse` — `sign`, `verify` |
|
|
235
235
|
| `pki.crmf` | Certificate-request-message issuance (RFC 4211). `build(spec, key, opts)` assembles a `CertReqMessages` from a `spec` of `certReqId` (default 0, with the RFC 9483 `-1` sentinel allowed), a `certTemplate` of the requested fields (`subject`, `publicKey` as the SPKI DER of the key being certified, `validity`, requested `extensions`, an optional `version` 2), optional `controls` and `regInfo` (regToken, authenticator, utf8Pairs, oldCertID, protocolEncrKey, or pre-encoded `AttributeTypeAndValue` DER), and an optional `pop` selector. `key` (or `{ key }`) is the requester's private key: the message carries a `POPOSigningKey` proof of possession signed with the private half of `certTemplate.publicKey` and verified before the message is returned, exactly as a PKCS#10 CSR proves possession. A complete template signs the `CertRequest`; an incomplete one signs a `POPOSigningKeyInput`. The signature algorithm is resolved from the requested public key, so RSA (PKCS#1 v1.5 or PSS via `opts.pss`), ECDSA, EdDSA, ML-DSA, SLH-DSA, and the composite arms all sign without a per-algorithm branch. `key` is optional for a `raVerified` proof. A key that cannot sign, which is where an ML-KEM enrollment sits, takes a `POPOPrivKey` proof instead (RFC 4211 sec. 4.2, sec. 4.3): `pop.type` of `keyEncipherment` or `keyAgreement` with `pop.method: 'subsequentMessage'` declares whether an encrypted certificate (`encrCert`) or a challenge (`challengeResp`) completes the proof over the enrolling protocol's next exchange, and `pop.method: 'encryptedKey'` encloses the requester's private key for the CA in a CMS `EnvelopedData` under `id-ct-encKeyWithID`, requiring `pop.privateKey`, `pop.recipients`, the `pop.identifier` sec. 4.2.1 makes mandatory, and `pop.archive: true` because RFC 9810 sec. 5.2.8.3.1 permits the method only where archival is intended. The enclosed key must be the private half of `certTemplate.publicKey`, or the proof demonstrates possession of a key the request never asked to have certified. The `thisMessage` and `dhMAC` alternatives the specification deprecates are refused with their successors named, and `agreeMAC` is not built, since it needs the RFC 2875 static Diffie-Hellman secret against a CA certificate the requester already holds. Pass an array of specs for a batch; the CA-assigned template fields are never emitted. Returns DER, or a PEM block with `opts.pem`; malformed input throws a typed `CrmfError`. `verifyPop(messages)` is the receiving side: for each `CertReqMsg` it verifies the `POPOSigningKey` signature over the bytes RFC 4211 sec. 4.1 names — the DER of `poposkInput` when present, of `certReq` when not — through the one path-validation signature engine, and answers `{ verified, messages: [{ verified, method, cryptographicallyVerified, certReqId, subject, subjectBound, publicKey, reason }] }` with the fields re-derived from the message's own bytes. Each verdict reports only what its preimage covers: `publicKey` is the key possession was proven for, and `subject` is the requested name when the `certReq` was signed. A `poposkInput` preimage covers the key and the sender alone, so any subject beside it is unsigned and is withheld with `subjectBound: false`. A `raVerified` proof is an RA's out-of-band assertion and a `keyEncipherment` or `keyAgreement` proof completes over a later exchange, so each is reported unverified with its `method` named instead of guessed. Parsing stays at `pki.schema.crmf.parse` — `build`, `verifyPop` |
|
|
236
|
-
| `pki.cmp` | CMP message building, transfer, and verification (RFC 9810). `build(message, opts)` assembles a protected `PKIMessage`. `message.header` carries the `sender` and `recipient` GeneralNames (including the anonymous NULL-DN) plus optional transaction metadata; `message.body` is a single-key object naming the arm — request-side `ir`, `cr`, `kur`, `p10cr`, `certConf`, `pollReq`, `genm`, `rr`,
|
|
236
|
+
| `pki.cmp` | CMP message building, transfer, and verification (RFC 9810). `build(message, opts)` assembles a protected `PKIMessage`. `message.header` carries the `sender` and `recipient` GeneralNames (including the anonymous NULL-DN) plus optional transaction metadata; `message.body` is a single-key object naming the arm — request-side `ir`, `cr`, `kur`, `p10cr`, `certConf`, `pollReq`, `genm`, `rr`, responder-side `ip`, `cp`, `kup`, `ccp`, `rp`, `genp`, `error`, `pollRep`, `krp`, `pkiconf`, and the registration-authority `nested` wrapper of complete PKIMessages (RFC 9810 §5.1.3.5). Protection is exactly one of `opts.{ key, cert }`, a signature under the sender key with the algorithm resolved from the signer certificate so RSA (PKCS#1 v1.5 / PSS), ECDSA, EdDSA, ML-DSA, SLH-DSA, and the composite arms all sign without a per-algorithm branch, or `opts.mac`, a PBMAC1 shared-secret HMAC (RFC 9481 / 9579, PBKDF2-derived). Protection covers the exact DER of the virtual `ProtectedPart` and is self-verified before the message is returned, and `protectionAlg` is derived rather than caller-set, so the message the parser accepts is coherent by construction. `transfer(url, message, opts)` carries a built message to a CMP endpoint over `pki.transport` (RFC 9811): one POST of the DER PKIMessage, with the response classified fail-closed — 200 only for success, a non-200 2xx or an un-followed 3xx refused, a 4xx or 5xx carrying a CMP error PKIMessage forwarded as the integrity-protected verdict — and protection surfaced rather than verified. `wellKnownUrl(base, opts)` builds the §3.4 `/.well-known/cmp` request-URIs. `verify(message, opts)` checks the protection on an incoming message, either a signature through the same certification-path engine `pki.crl.verify` and `pki.ocsp.verify` use, with the EdDSA low-order-point and algorithm-confusion gates, or a PBMAC1 MAC recomputed from `opts.sharedSecret` and the message's own PBKDF2 parameters and constant-time compared, over the exact `ProtectedPart` reconstructed from the parser's raw slices. It is fail-closed on an unprotected message, a legacy or KEM MAC algorithm, an omitted keyLength, or a SHA-1 PRF, and returns a `{ valid, trusted, protectionType, signer, ... }` verdict. With `opts.trustAnchors` the signer certificate is fully path-validated (RFC 5280 §6.1 plus the RFC 9483 §3.2 `keyUsage.digitalSignature` gate) at a trusted current time, or an explicit `opts.time` for historical verification and never the message's self-asserted `messageTime`, before it is reported trusted; without one the verdict is crypto-only and the signer certificate is surfaced to anchor. `session(opts)` returns a stateful enrollment session whose `enroll(request)` drives a full `ir` / `cr` / `kur` / `p10cr` transaction over the shared transport, composing `build`, `transfer`, and `verify`. Every response is protection-verified, signer-trusted, and bound to the exchange (a stable `transactionID`, a fresh-`senderNonce` and echoed-`recipNonce` chain) before its body is read, with a bounded `pollReq` / `pollRep` loop for a `waiting` status and a `certConf` / `pkiConf` (or implicit) confirmation carrying an explicit `hashAlg` for a signature algorithm that does not convey its hash. It returns a terminal `{ outcome, certificate, chain, status, trusted, confirmed, implicitConfirm, transactionID, polls, transcript }`. The same session also drives the other two RFC 9483 operations under that shell: `revoke(request)` sends an `rr` naming a certificate as `{ certificate }` or `{ certDetails }` with an optional CRLReason `reason`, and returns `revoked` / `rejected` / `poll-timeout`; `info(request)` sends a `genm` for one of the four support messages — `{ caCerts }`, `{ rootCaCert }`, `{ certReqTemplate }`, `{ crlUpdate }` — and returns `answered` with the decoded `value` and a `present` flag, since an absent response value is how each says nothing is available. A session revokes its own certificate: the signature over the request is the proof of authorization (§4.2), so the named certificate must be `opts.cert` and a PBMAC1 session is refused. The signature flavor requires `opts.trustAnchors` to authenticate the CA; a verified rejection or error and an exhausted poll budget are terminal verdicts, while a tampered, untrusted, or desynchronized response is a typed throw. Returns DER, or a PEM `CMP` block with `opts.pem`; malformed input throws a typed `CmpError`. Parsing stays at `pki.schema.cmp.parse` — `build`, `transfer`, `wellKnownUrl`, `verify`, `session` |
|
|
237
237
|
| `pki.crl` | CRL issuance and verification (RFC 5280 §5). `sign(spec, issuer, opts)` builds and signs a `CertificateList` from a `spec` of `thisUpdate` and `nextUpdate`, an optional `crlNumber`, a `revoked` array (each entry a `serialNumber` and `revocationDate` with an optional `reason` or `invalidityDate`), and an optional `extensions` object (authority key identifier, issuing distribution point, delta-CRL indicator, freshest CRL, authority information access) or an array of pre-encoded Extension DER, with an `issuer` of `{ cert, key }` or `{ name, publicKey, key }`. The signature algorithm is resolved from the issuer key, so RSA (PKCS#1 v1.5 or PSS via `opts.pss`), ECDSA, EdDSA, ML-DSA, SLH-DSA, and the composite arms all sign without a per-algorithm branch. The version is derived from the extension set (v2 when any CRL or entry extension is present, else v1), the outer `signatureAlgorithm` matches `tbsCertList.signature`, an empty revocation list omits the field rather than emitting an empty SEQUENCE, `reasonCode` is an ENUMERATED and `invalidityDate` is always GeneralizedTime, the RFC fixes per-extension criticality, and the produced signature is verified under the issuer key before return. `verify(crl, issuer)` checks a CRL signature through the one path-validation signature engine, algorithm-confusion and EdDSA low-order gates included; handed a certificate rather than a bare key it also asks what only a certificate can answer — that the certificate is the issuer the CRL names, and that its `keyUsage`, when present, asserts `cRLSign` — so a CRL minted under an end-entity certificate of the same CA does not verify as that CA's. `isRevoked(crl, serialNumber, opts)` looks a serial up, and first checks that the CRL is one a serial can be looked up in at all — it is handed a serial and nothing else, so a CRL that speaks for part of its issuer's certificates is refused rather than answered from. A delta CRL lists changes since a base, so an entry recording a release reads as a revocation when read alone; an indirect CRL carries other issuers' entries, whose serials are unrelated to yours; and any other `issuingDistributionPoint` narrows the CRL to one distribution point, one kind of certificate, or a subset of revocation reasons, none of which a serial can be matched against. A CRL speaks for a span as well as a set, so `opts.time` states the instant the question is asked at and a list that has stopped speaking for it — `nextUpdate` passed, `thisUpdate` later, or no `nextUpdate` stated at all — is refused rather than read as a clean bill of health; without `opts.time` the lookup is structural and an absent serial means only that it is not on that list. `pki.path.crlChecker` is the verb for all of them: it is handed the certificate, merges a delta with its base, performs the §6.3.3 correspondence, and decides currency against the material it fetched. Returns DER, or a PEM `X509 CRL` with `opts.pem`; malformed input throws a typed `CrlError`. Parsing stays at `pki.schema.crl.parse` — `sign`, `verify`, `isRevoked` |
|
|
238
238
|
| `pki.key` | Key-material lifecycle (RFC 5958 / RFC 8018). `encrypt(privateKey, password, opts)` wraps a PKCS#8 private key (DER, PEM, or an extractable `CryptoKey`) into an `EncryptedPrivateKeyInfo` under PBES2 (PBKDF2 with AES-CBC-Pad), where `opts` selects the `cipher` (`aes-256-cbc` default, `aes-192-cbc`, `aes-128-cbc`), the `prf` (`hmacWithSHA256` default, SHA-384/512, SHA-1), the `iterations` (default 600000), and the `salt`. The plaintext is validated as PKCS#8 before encryption, a default `prf` and `keyLength` are omitted so the parameters are byte-exact with OpenSSL, and the output is re-parsed before return. `decrypt(encrypted, password, opts)` recovers the inner `PrivateKeyInfo`, re-validated through `pki.schema.pkcs8.parse`: only PBES2 / PBKDF2 / AES-CBC is accepted (PBES1, PBMAC1, and scrypt are refused), the salt and iteration count are bounded before any derivation (`opts.maxIterations` lowers the cap), and a malformed parameter set or wrong-length IV is a distinct typed error. Because a MAC-less PBES2-CBC decrypt must not become a padding oracle (RFC 8018 §8), a wrong password and a valid-pad-but-not-a-key both surface the one uniform `key/decrypt-failed`. `export(key, opts)` and `import(input, opts)` move a private key as PKCS#8 or a public key as SubjectPublicKeyInfo. The key may come from the platform's WebCrypto or from a separately installed copy of this toolkit, and is exported through whichever holds its material; a non-extractable key, or one whose implementation keeps its material out of reach, is refused with that as the reason. Encoding is delegated to WebCrypto, so RSA carries an explicit NULL, EC a named curve, and Ed25519/Ed448/X25519/X448 omit parameters, and an ambiguous RSA or EC import requires `opts.algorithm`. `generate(algorithm, opts)` produces a key pair over RSA, ECDSA/ECDH, the Edwards and Montgomery curves, and the FIPS post-quantum ML-DSA and ML-KEM; `publicFromPrivate(privateKey)` derives the public key. Returns DER or PEM, with a typed `KeyError` on failure. Parsing stays at `pki.schema.pkcs8.parse` — `encrypt`, `decrypt`, `export`, `import`, `generate`, `publicFromPrivate` |
|
|
239
239
|
| `pki.pkcs12` | PKCS#12 (.p12/.pfx) issuance and reading (RFC 7292 / RFC 9579). `build(spec, opts)` assembles a store from the OpenSSL-style `{ key, cert, ca?, friendlyName?, localKeyId? }` or the full `{ safeContents: [...] }`, where each element is a plaintext or PBES2-encrypted `SafeContents` of key, shroudedKey, cert, crl, secret, or nested `safeContents` bags. Keys and certs are validated before wrapping, and `friendlyName` (BMPString) and `localKeyId` are single-value. Integrity is a classic Appendix B HMAC (the default, for maximum interoperability) or an RFC 9579 PBMAC1 (`opts.mac.algorithm`) over SHA-256/384/512, with shrouded keys and cert safes encrypted under RFC 8018 PBES2 (AES-128/192/256-CBC). Every password is encoded the PKCS#12 way — BMPString+NULL for the classic MAC, UTF-8 for the PBES2 bags and PBMAC1 — which is what OpenSSL and NSS consume, so a file it emits opens in both, cross-checked bidirectionally. The MAC covers the exact AuthenticatedSafe byte range, a DEFAULT-1 `MacData.iterations` is rejected up front, and the store is re-parsed before return. `verifyMac(pfx, password, opts)` recomputes a classic or PBMAC1 MAC over `macedBytes` and constant-time-compares it, throwing on a MAC-less or public-key-integrity store. Public-key integrity (`opts.integrity.mode: "public-key"`) wraps the AuthenticatedSafe in a CMS SignedData instead of a MAC, signed by any `pki.cms.sign` signer and carrying no MacData (§4); privacy stays independent, so `password` still PBES2-encrypts the bags. Public-key privacy wraps a SafeContents as a CMS EnvelopedData (AES-CBC, `id-envelopedData`, never GCM) encrypted to recipient public keys through the `pki.cms.encrypt` recipient model, via per-safe `recipients` or the `opts.recipientCerts` convenience, restricted to certificate recipients (RSA-OAEP, ECDH, X25519, X448, ML-KEM) since a password or KEK recipient could not be reopened by `open`. All four integrity-by-privacy combinations are permitted (§3.1). `open(pfx, password, opts)` reads a store back: it verifies the MAC first, so a wrong password is the MAC verdict rather than a decrypt error, then PBES2-decrypts every privacy safe and shrouded key bag and returns `{ integrityMode, macVerified, signers, keys, certs, crls, secrets }` — keys as re-validated PKCS#8 DER, certs, CRLs and secrets as raw DER, all with `friendlyName` and `localKeyId`, nested safes recursively. A MAC-less store is refused unless `opts.allowUnauthenticated`. A public-key-integrity store is verified through its CMS SignedData signature first (`pkcs12/signature-invalid` on failure), with the signer surfaced in `signers` but never trust-chained, which remains the caller's `pki.path.validate` step. A legacy-PBE store's Appendix C 3DES and RC2 bags are decrypted, RC2 through an in-tree RFC 2268 cipher, so an `openssl pkcs12 -legacy` or NSS store opens; the legacy RC4 schemes are refused. An `id-envelopedData` safe is decrypted with `opts.recipientKey` after the integrity gate (`pkcs12/no-recipient-key` when absent), every recipient-side fault and every post-integrity decrypt failure collapsing to the uniform `pkcs12/decrypt-failed`, and `opts.keys: 'crypto'` imports each key to a `CryptoKey`. It reads what OpenSSL and NSS produce. Returns DER or a PEM `PKCS12`, with a typed `Pkcs12Error` on failure. Parsing stays at `pki.schema.pkcs12.parse` — `build`, `verifyMac`, `open` |
|
package/lib/cmp-build.js
CHANGED
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
* @intro The RFC 9810 Certificate Management Protocol producing side. `pki.cmp.build` assembles a
|
|
11
11
|
* `PKIMessage` -- a `PKIHeader` (sender / recipient / transaction metadata), a `PKIBody` carrying one
|
|
12
12
|
* request or transaction (an `ir` / `cr` / `kur` certificate request via `pki.crmf.build`, a `p10cr`
|
|
13
|
-
* PKCS#10 via `pki.csr.sign`,
|
|
13
|
+
* PKCS#10 via `pki.csr.sign`, a `certConf` / `pollReq` / `genm` / `rr`, or a `nested` wrapper of other
|
|
14
|
+
* PKIMessages an RA forwards), and an optional
|
|
14
15
|
* `PKIProtection` computed over the message. Protection is a signature under the sender key (any
|
|
15
16
|
* registry algorithm) or a PBMAC1 shared-secret MAC. The emitted message round-trips through
|
|
16
17
|
* `pki.schema.cmp.parse` and its protection verifies. `pki.cmp.transfer` carries a message to a CMP
|
|
@@ -91,11 +92,13 @@ var KNOWN_HEADER_KEYS = {
|
|
|
91
92
|
var KNOWN_BODY_KEYS = {
|
|
92
93
|
ir: 1, cr: 1, kur: 1, p10cr: 1, certConf: 1, pollReq: 1, genm: 1, rr: 1, // request-side
|
|
93
94
|
ip: 1, cp: 1, kup: 1, ccp: 1, krp: 1, rp: 1, genp: 1, error: 1, pollRep: 1, pkiconf: 1, // CA/responder-side
|
|
95
|
+
nested: 1, // an RA wrapper of complete, independently-protected PKIMessages (RFC 9810 sec. 5.1.3.5)
|
|
94
96
|
};
|
|
95
97
|
// The PKIBody arm -> its EXPLICIT context tag number (schema-cmp.js BODY_ARMS). rr is [11], not [15].
|
|
96
98
|
var BODY_TAG = {
|
|
97
99
|
ir: 0, cr: 2, p10cr: 4, kur: 7, rr: 11, genm: 21, certConf: 24, pollReq: 25,
|
|
98
100
|
ip: 1, cp: 3, kup: 8, krp: 10, rp: 12, ccp: 14, pkiconf: 19, genp: 22, error: 23, pollRep: 26,
|
|
101
|
+
nested: 20, // NestedMessageContent (schema-cmp.js BODY_ARMS [20])
|
|
99
102
|
};
|
|
100
103
|
var CRMF_BODY = { ir: 1, cr: 1, kur: 1 }; // arms whose content is a CertReqMessages via pki.crmf.build
|
|
101
104
|
var CERT_REP_ARM = { ip: 1, cp: 1, kup: 1, ccp: 1 }; // arms carrying a CertRepMessage
|
|
@@ -460,7 +463,7 @@ function _encodeCertOrEncCert(coec, state) {
|
|
|
460
463
|
if (!coec || typeof coec !== "object" || Buffer.isBuffer(coec)) throw _err("cmp/bad-cert-response", "certifiedKeyPair must carry certificate or encryptedCert");
|
|
461
464
|
if (coec.certificate != null && coec.encryptedCert != null) throw _err("cmp/bad-cert-response", "certOrEncCert is a CHOICE: supply exactly one of certificate or encryptedCert, not both");
|
|
462
465
|
if (coec.certificate != null) {
|
|
463
|
-
var certDer = _b.
|
|
466
|
+
var certDer = _b.reqDerSequence(coec.certificate, "certifiedKeyPair.certificate (a Certificate DER)");
|
|
464
467
|
try { x509.parse(certDer); } catch (e) { if (e instanceof CmpError) throw e; throw _err("cmp/bad-cert-response", "certifiedKeyPair.certificate is not a valid X.509 certificate", e); }
|
|
465
468
|
return b.explicit(0, b.raw(certDer)); // certificate [0] EXPLICIT
|
|
466
469
|
}
|
|
@@ -524,7 +527,7 @@ function _encodeCertRepMessage(spec, state, arm) {
|
|
|
524
527
|
|
|
525
528
|
// A raw Certificate DER, validated via the real parser before it is embedded.
|
|
526
529
|
function _certRaw(c, code, what) {
|
|
527
|
-
var der = _b.
|
|
530
|
+
var der = _b.reqDerSequence(c, what + " (a Certificate DER)");
|
|
528
531
|
try { x509.parse(der); } catch (e) { if (e instanceof CmpError) throw e; throw _err(code, what + " is not a valid X.509 certificate", e); }
|
|
529
532
|
return b.raw(der);
|
|
530
533
|
}
|
|
@@ -545,7 +548,7 @@ function _encodeRevRepContent(spec) {
|
|
|
545
548
|
if (spec.crls != null) {
|
|
546
549
|
if (!Array.isArray(spec.crls) || !spec.crls.length) throw _err("cmp/bad-rev-rep", "rp.crls must be a non-empty array of CertificateList DERs");
|
|
547
550
|
children.push(b.explicit(1, b.sequence(spec.crls.map(function (c) {
|
|
548
|
-
var der = _b.
|
|
551
|
+
var der = _b.reqDerSequence(c, "crls entry (a CertificateList DER)");
|
|
549
552
|
try { crl.parse(der); } // each crls entry MUST be a valid X.509 CRL (CertificateList)
|
|
550
553
|
catch (e) { if (e instanceof CmpError) throw e; throw _err("cmp/bad-rev-rep", "a crls entry is not a valid CRL (CertificateList)", e); }
|
|
551
554
|
return b.raw(der);
|
|
@@ -616,6 +619,36 @@ function _popNeedsCmp2021(crmfDer) {
|
|
|
616
619
|
return false;
|
|
617
620
|
}
|
|
618
621
|
|
|
622
|
+
// nested [20] NestedMessageContent ::= PKIMessages ::= SEQUENCE SIZE (1..MAX) OF PKIMessage (RFC 9810 sec.
|
|
623
|
+
// 5.1.3.5 "Multiple Protection"): an RA forwards or batches complete, independently-protected PKIMessages,
|
|
624
|
+
// wrapping them UNCHANGED under its OWN protection. Each entry is a full PKIMessage DER, checked by the real
|
|
625
|
+
// parser so a non-PKIMessage fails closed here rather than wrapping as opaque bytes. The check is the toolkit's
|
|
626
|
+
// PKIMessage parse: it validates the envelope and every arm the parser decodes and, exactly as a parse
|
|
627
|
+
// anywhere else does, surfaces the raw arms (p10cr, the announcements, a further nested) without re-validating
|
|
628
|
+
// their content -- which sec. 5.1.3.5 leaves to the recipient, since the RA forwards each message unchanged.
|
|
629
|
+
// The wrapper's protection covers this SEQUENCE, not the inner messages, and the parser never auto-recurses a
|
|
630
|
+
// nested body (the operator re-feeds each inner message).
|
|
631
|
+
function _encodeNestedContent(list) {
|
|
632
|
+
if (!intrinsic.isArray(list) || list.length === 0) {
|
|
633
|
+
throw _err("cmp/bad-input", "nested must be a non-empty array of PKIMessage DER (RFC 9810 sec. 5.1.3.5 PKIMessages is SIZE (1..MAX))");
|
|
634
|
+
}
|
|
635
|
+
// reqDenseArray rejects a sparse hole or a nullish entry up front: Array.prototype.map SKIPS a hole,
|
|
636
|
+
// which would otherwise reach Buffer.concat as a native ERR_INVALID_ARG_TYPE and, on a huge sparse
|
|
637
|
+
// length, traverse the empty slots. With the array proven dense, the map validates each entry in turn.
|
|
638
|
+
return b.sequence(intrinsic.map(_b.reqDenseArray(list, "nested"), function (m, i) {
|
|
639
|
+
// reqDerSequence requires a DER SEQUENCE up front: cmp.parse also unwraps PEM from a byte source, so a
|
|
640
|
+
// PEM-armored entry (a Buffer straight from fs.readFileSync) would otherwise pass the parse yet be
|
|
641
|
+
// embedded by b.raw as ASCII armor and rejected as cmp/bad-der by the outer message's own parse, only
|
|
642
|
+
// after protection is computed. With DER assured, the bytes cmp.parse checks are the bytes embedded.
|
|
643
|
+
var der = _b.reqDerSequence(m, "nested[" + i + "] (a PKIMessage DER)");
|
|
644
|
+
// A bad entry is a build-time authoring error, so any parse failure is one uniform cmp/bad-input naming
|
|
645
|
+
// the offending index (the underlying reason rides along as the cause), never the parser's internal code.
|
|
646
|
+
try { cmp.parse(der); } // check each embedded message parses as a PKIMessage (fail-closed on a non-PKIMessage)
|
|
647
|
+
catch (e) { throw _err("cmp/bad-input", "nested[" + i + "] does not parse as a PKIMessage", e); }
|
|
648
|
+
return b.raw(der);
|
|
649
|
+
}));
|
|
650
|
+
}
|
|
651
|
+
|
|
619
652
|
// Dispatch the single-key body object to its EXPLICIT-tagged arm. Returns { bodyTLV, usesCmp2021 }.
|
|
620
653
|
function _encodeBody(bodySpec, key, opts) {
|
|
621
654
|
if (!bodySpec || typeof bodySpec !== "object" || Buffer.isBuffer(bodySpec)) throw _err("cmp/bad-input", "message.body must be a single-key object");
|
|
@@ -647,7 +680,7 @@ function _encodeBody(bodySpec, key, opts) {
|
|
|
647
680
|
}
|
|
648
681
|
var inner;
|
|
649
682
|
if (arm === "p10cr") {
|
|
650
|
-
var csrDer = _b.
|
|
683
|
+
var csrDer = _b.reqDerSequence(bodySpec.p10cr, "p10cr (a CertificationRequest DER)");
|
|
651
684
|
try { csr.parse(csrDer); } // validate the embedded PKCS#10 via the real parser (fail-closed on a non-CSR)
|
|
652
685
|
catch (e) { if (e instanceof CmpError) throw e; throw _err("cmp/bad-input", "p10cr is not a valid PKCS#10 CertificationRequest", e); }
|
|
653
686
|
inner = b.raw(csrDer);
|
|
@@ -671,6 +704,8 @@ function _encodeBody(bodySpec, key, opts) {
|
|
|
671
704
|
inner = _encodePollRepContent(bodySpec.pollRep);
|
|
672
705
|
} else if (arm === "krp") {
|
|
673
706
|
inner = _encodeKeyRecRepContent(bodySpec.krp, state);
|
|
707
|
+
} else if (arm === "nested") {
|
|
708
|
+
inner = _encodeNestedContent(bodySpec.nested);
|
|
674
709
|
} else { // pkiconf -- PKIConfirmContent ::= NULL
|
|
675
710
|
if (bodySpec.pkiconf !== null && bodySpec.pkiconf !== true) throw _err("cmp/bad-input", "pkiconf takes null or true (PKIConfirmContent is NULL)");
|
|
676
711
|
inner = b.nullValue();
|
|
@@ -691,7 +726,7 @@ function _resolveProtection(opts) {
|
|
|
691
726
|
|
|
692
727
|
if (hasSig) {
|
|
693
728
|
if (opts.key == null || opts.cert == null) throw _err("cmp/bad-input", "signature protection requires both opts.key (the private key) and opts.cert (the signer certificate)");
|
|
694
|
-
var certDer = _b.
|
|
729
|
+
var certDer = _b.reqDerSequence(opts.cert, "opts.cert (the signer certificate DER)");
|
|
695
730
|
var senderSpki;
|
|
696
731
|
try { senderSpki = x509.parse(certDer).subjectPublicKeyInfo.bytes; }
|
|
697
732
|
catch (e) { throw _err("cmp/bad-input", "opts.cert is not a valid X.509 certificate", e); }
|
|
@@ -821,7 +856,7 @@ function _collectExtraCerts(opts, protCertDer) {
|
|
|
821
856
|
if (opts.extraCerts != null) {
|
|
822
857
|
if (!Array.isArray(opts.extraCerts)) throw _err("cmp/bad-extra-certs", "opts.extraCerts must be an array of certificate DERs");
|
|
823
858
|
opts.extraCerts.forEach(function (c) {
|
|
824
|
-
var der = _b.
|
|
859
|
+
var der = _b.reqDerSequence(c, "extraCerts entry (a Certificate DER)");
|
|
825
860
|
try { x509.parse(der); } // each extraCerts entry MUST be a valid X.509 certificate (RFC 9810 sec. 5.1)
|
|
826
861
|
catch (e) { if (e instanceof CmpError) throw e; throw _err("cmp/bad-extra-certs", "an extraCerts entry is not a valid X.509 certificate", e); }
|
|
827
862
|
out.push(b.raw(der));
|
|
@@ -846,7 +881,10 @@ function _collectExtraCerts(opts, protCertDer) {
|
|
|
846
881
|
* CertificationRequest DER), `{ certConf }`, `{ pollReq }`, `{ genm }`, `{ rr }`. CA/responder-side: `{ ip }` /
|
|
847
882
|
* `{ cp }` / `{ kup }` / `{ ccp }` (a `CertRepMessage`: `caPubs` plus `response` of `CertResponse` each with a
|
|
848
883
|
* `PKIStatusInfo` and, under a granting status, a `certifiedKeyPair`), `{ rp }` (`RevRepContent`), `{ genp }`,
|
|
849
|
-
* `{ error }` (`ErrorMsgContent`), `{ pollRep }`, `{ krp }` (`KeyRecRepContent`), `{ pkiconf }` (NULL).
|
|
884
|
+
* `{ error }` (`ErrorMsgContent`), `{ pollRep }`, `{ krp }` (`KeyRecRepContent`), `{ pkiconf }` (NULL).
|
|
885
|
+
* Registration-authority: `{ nested }` (an array of complete PKIMessage DER, each forwarded unchanged and
|
|
886
|
+
* wrapped as `NestedMessageContent`, RFC 9810 sec. 5.1.3.5; each entry is checked to parse as a PKIMessage
|
|
887
|
+
* before it is wrapped, and an empty array or an entry that does not parse is refused). The
|
|
850
888
|
* message is protected: `opts` carries exactly
|
|
851
889
|
* one of `{ key, cert }` (a signature under the sender key over the message, using any registry algorithm: RSA
|
|
852
890
|
* / ECDSA / EdDSA / ML-DSA / SLH-DSA / composite, resolved from the certificate) or `{ mac }` (a PBMAC1
|
package/lib/cms-sign.js
CHANGED
|
@@ -441,7 +441,7 @@ async function _signStream(stream, signers, opts) {
|
|
|
441
441
|
throw _err("cms/bad-input", "a streaming content cannot be signed without signed attributes: the message-digest " +
|
|
442
442
|
"attribute is the streamed hash, and there is no content to sign directly (RFC 5652 sec. 5.4)");
|
|
443
443
|
}
|
|
444
|
-
var list = intrinsic.isArray(signers) ? signers : [signers];
|
|
444
|
+
var list = intrinsic.isArray(signers) ? _b.reqDenseArray(signers, "the signer list") : [signers];
|
|
445
445
|
if (!list.length) throw _err("cms/bad-input", "pki.cms.sign requires at least one signer");
|
|
446
446
|
var eContentType = opts.eContentType ? O(opts.eContentType) : OID_DATA;
|
|
447
447
|
if (eContentType === OID_PKI_DATA && list.length > 1 &&
|
|
@@ -495,7 +495,7 @@ function _sign(content, signers, opts) {
|
|
|
495
495
|
// the attribute-shaped-content check while the signer signs that content directly, which is the
|
|
496
496
|
// very signature the stripping attack needs.
|
|
497
497
|
var contentBuf = _toBuf(content, "content");
|
|
498
|
-
var list = Array.isArray(signers) ? signers : [signers];
|
|
498
|
+
var list = Array.isArray(signers) ? _b.reqDenseArray(signers, "the signer list") : [signers];
|
|
499
499
|
if (!list.length) throw _err("cms/bad-input", "pki.cms.sign requires at least one signer");
|
|
500
500
|
var eContentType = opts.eContentType ? O(opts.eContentType) : OID_DATA;
|
|
501
501
|
// RFC 5272 sec. 3.2: "If the request key is used for signing, there MUST be only
|
package/lib/guard-bytes.js
CHANGED
|
@@ -69,6 +69,24 @@ var _Map = intrinsic.Map;
|
|
|
69
69
|
// Appended by index rather than through `push`, so the growth reads no prototype method at all.
|
|
70
70
|
function _append(arr, v) { _defineProperty(arr, arr.length, { value: v, writable: true, enumerable: true, configurable: true }); }
|
|
71
71
|
|
|
72
|
+
// The array's OWN element indices below `length`, the positions it actually holds rather than the ones
|
|
73
|
+
// a read resolves. A hole reads through the prototype chain, so enumerating what reads resolve would
|
|
74
|
+
// materialize an inherited index -- a polluted `Array.prototype[i]` among them -- as an own element on
|
|
75
|
+
// the copy, importing a value the array never held. Copying own indices alone leaves the hole a hole,
|
|
76
|
+
// so the caller-array density check the verbs apply sees the original sparsity and refuses it, rather
|
|
77
|
+
// than the copy silently answering with a prototype-supplied element.
|
|
78
|
+
function _ownArrayIndices(v, n) {
|
|
79
|
+
var keys = _ownKeys(v);
|
|
80
|
+
var out = [];
|
|
81
|
+
for (var j = 0; j < keys.length; j++) {
|
|
82
|
+
var k = keys[j];
|
|
83
|
+
if (typeof k !== "string") continue;
|
|
84
|
+
var ix = k >>> 0;
|
|
85
|
+
if (_String(ix) === k && ix !== 0xFFFFFFFF && ix < n) _append(out, k);
|
|
86
|
+
}
|
|
87
|
+
return out;
|
|
88
|
+
}
|
|
89
|
+
|
|
72
90
|
// isByteSource(x) -> boolean: is this one of the four forms the toolkit calls bytes?
|
|
73
91
|
//
|
|
74
92
|
// A Buffer, any typed-array view, a DataView, or a bare ArrayBuffer. Exported so a door deciding
|
|
@@ -822,20 +840,27 @@ function _deep(v, ErrorClass, code, label, cap, depth, collect) {
|
|
|
822
840
|
}
|
|
823
841
|
if (_isArray(v)) {
|
|
824
842
|
var arr = [];
|
|
825
|
-
// The indices a read on the array resolves, rather than a count from zero to `length`. An
|
|
826
|
-
//
|
|
827
|
-
//
|
|
828
|
-
//
|
|
829
|
-
//
|
|
830
|
-
//
|
|
831
|
-
// the same.
|
|
843
|
+
// The indices a read on the array resolves, rather than a count from zero to `length`. An array is
|
|
844
|
+
// sparse whenever a caller sets a high index or assigns `length`, and `[].length = 4e9` is one
|
|
845
|
+
// statement: walking to `length` then does four billion iterations for an array holding nothing,
|
|
846
|
+
// inside a guard whose job includes keeping a caller's argument from costing unbounded work. Copying
|
|
847
|
+
// the indices it actually holds costs what it holds; `length` is carried across afterwards so trailing
|
|
848
|
+
// holes survive and the copy measures the same.
|
|
832
849
|
//
|
|
833
|
-
//
|
|
834
|
-
//
|
|
835
|
-
//
|
|
836
|
-
//
|
|
850
|
+
// OWN indices only, and refuse an index a read resolves through the PROTOTYPE. An array reads its
|
|
851
|
+
// holes through the prototype chain, so an inherited in-range index -- a polluted `Array.prototype[i]`,
|
|
852
|
+
// or one a hostile prototype supplies -- is a value the caller never placed on the array. Materializing
|
|
853
|
+
// it would import it; leaving it a hole would let a verb's map silently skip an element the array
|
|
854
|
+
// appears to hold. Neither is safe, so the copy refuses it, once, for every argument the module copies,
|
|
855
|
+
// rather than each verb having to. A GENUINE hole -- own-absent AND prototype-absent -- is preserved,
|
|
856
|
+
// so an ordinary sparse array round-trips unchanged and the per-verb density check on a list that must
|
|
857
|
+
// be dense still refuses that. `readableIndices` walks own + inherited in-range indices; when it holds
|
|
858
|
+
// one the array does not own, an in-range index came from the prototype.
|
|
837
859
|
var indexE = function (c, m) { return _raise(ErrorClass, c, m); };
|
|
838
|
-
var indices =
|
|
860
|
+
var indices = _ownArrayIndices(v, v.length);
|
|
861
|
+
if (identifier.readableIndices(v, indexE, code, label).length !== indices.length) {
|
|
862
|
+
throw _raise(ErrorClass, code, label + " has an in-range index supplied by its prototype rather than the array itself; a list resolved through the prototype chain is refused");
|
|
863
|
+
}
|
|
839
864
|
// An accessor is refused among the elements for the reason it is refused among the names:
|
|
840
865
|
// reading it once and writing what it returned as plain data leaves the later check nothing
|
|
841
866
|
// to find, since it sees a value and cannot tell an accessor was ever there. The refusal
|
package/lib/pki-build.js
CHANGED
|
@@ -593,6 +593,35 @@ function makeBuilder(ctx) {
|
|
|
593
593
|
if (guard.bytes.isByteSource(v)) return guard.bytes.snapshotSource(v, ErrorClass, ctx.prefix + "/bad-input", what);
|
|
594
594
|
throw E("bad-input", what + " must be a DER Buffer");
|
|
595
595
|
}
|
|
596
|
+
// A caller-supplied array a builder is about to map over: reject a sparse hole or a nullish entry HERE
|
|
597
|
+
// as a typed error. Array.prototype.map SKIPS a hole, which would otherwise reach Buffer.concat as a
|
|
598
|
+
// native ERR_INVALID_ARG_TYPE and, on a huge sparse length, traverse the empty slots. Test OWN-property
|
|
599
|
+
// presence at each index BEFORE reading it: a bare `list[i]` on a hole walks the prototype chain, so a
|
|
600
|
+
// polluted `Array.prototype[i]` would read as a value and slip a hole past the check while map still
|
|
601
|
+
// skips it. Fails fast at the first bad index, so the length alone can never force a walk. Returns the
|
|
602
|
+
// validated dense array for the caller to map normally.
|
|
603
|
+
function reqDenseArray(list, what) {
|
|
604
|
+
if (!_isArray(list)) throw E("bad-input", what + " must be an array");
|
|
605
|
+
var n = list.length;
|
|
606
|
+
for (var i = 0; i < n; i++) {
|
|
607
|
+
if (!intrinsic.hasOwn(list, i)) throw E("bad-input", what + "[" + i + "] is missing (a sparse array is not allowed)");
|
|
608
|
+
var v = list[i];
|
|
609
|
+
if (v === undefined || v === null) throw E("bad-input", what + "[" + i + "] is missing (a nullish array entry is not allowed)");
|
|
610
|
+
}
|
|
611
|
+
return list;
|
|
612
|
+
}
|
|
613
|
+
// A caller-supplied DER a builder validates with a PEM-accepting parser and then embeds verbatim with
|
|
614
|
+
// b.raw. Those parsers unwrap PEM from a byte source, so a PEM-armored input (a Buffer straight from
|
|
615
|
+
// fs.readFileSync) passes the parse, but b.raw embeds the raw ASCII armor -- which the enclosing
|
|
616
|
+
// structure's own parse rejects only later, after protection is computed, and with the wrong code.
|
|
617
|
+
// Require a DER SEQUENCE first (a Certificate / CRL / CSR / PKIMessage / CertReqMessages is one; PEM
|
|
618
|
+
// opens with 0x2D), so a PEM or non-DER input is a typed bad-input up front and the bytes the parse
|
|
619
|
+
// checks are the bytes embedded.
|
|
620
|
+
function reqDerSequence(v, what) {
|
|
621
|
+
var der = reqDer(v, what);
|
|
622
|
+
if (der.length === 0 || der[0] !== 0x30) throw E("bad-input", what + " must be DER (a SEQUENCE), not PEM or other bytes");
|
|
623
|
+
return der;
|
|
624
|
+
}
|
|
596
625
|
// Full validation of an embedded SubjectPublicKeyInfo, walked through the parser the decoder uses.
|
|
597
626
|
function assertValidSpki(spkiDer, what) {
|
|
598
627
|
var node;
|
|
@@ -761,7 +790,7 @@ function makeBuilder(ctx) {
|
|
|
761
790
|
extBasicConstraints: extBasicConstraints, pathLen: pathLen, extSki: extSki, extAki: extAki,
|
|
762
791
|
extSan: extSan, extCertPolicies: extCertPolicies, ext: ext,
|
|
763
792
|
spkiKeyId: spkiKeyId, skiKeyId: skiKeyId,
|
|
764
|
-
reqDer: reqDer, assertValidSpki: assertValidSpki, assertValidExtension: assertValidExtension,
|
|
793
|
+
reqDer: reqDer, reqDenseArray: reqDenseArray, reqDerSequence: reqDerSequence, assertValidSpki: assertValidSpki, assertValidExtension: assertValidExtension,
|
|
765
794
|
certLikeFromSpki: certLikeFromSpki, assertSignatureVerifies: assertSignatureVerifies,
|
|
766
795
|
samePublicKey: samePublicKey,
|
|
767
796
|
};
|
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:b9e9adce-3734-44f4-bad1-560111dc9c46",
|
|
6
6
|
"version": 1,
|
|
7
7
|
"metadata": {
|
|
8
|
-
"timestamp": "2026-08-
|
|
8
|
+
"timestamp": "2026-08-29T15:51:59.314Z",
|
|
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.35",
|
|
23
23
|
"type": "application",
|
|
24
24
|
"name": "pki",
|
|
25
|
-
"version": "0.5.
|
|
25
|
+
"version": "0.5.35",
|
|
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.35",
|
|
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.35",
|
|
58
58
|
"dependsOn": []
|
|
59
59
|
}
|
|
60
60
|
]
|