@blamejs/pki 0.8.55 → 0.8.56

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/lib/acme.js +2 -2
  3. package/lib/asn1-der.js +17 -5
  4. package/lib/attrcert-verify.js +1 -1
  5. package/lib/cmc-verify.js +1 -1
  6. package/lib/cmp-session.js +2 -2
  7. package/lib/cmp-verify.js +2 -2
  8. package/lib/cms-decrypt.js +4 -1
  9. package/lib/cms-encrypt.js +4 -1
  10. package/lib/cms-sign.js +26 -12
  11. package/lib/cms-verify.js +1 -1
  12. package/lib/composite-kem.js +30 -12
  13. package/lib/composite-sig.js +42 -23
  14. package/lib/constants.js +7 -2
  15. package/lib/crl-verify.js +1 -1
  16. package/lib/crmf-sign.js +72 -43
  17. package/lib/crmf-verify.js +1 -1
  18. package/lib/csr-verify.js +1 -1
  19. package/lib/ct.js +2 -2
  20. package/lib/edwards-point.js +1 -1
  21. package/lib/est.js +3 -3
  22. package/lib/guard-async.js +22 -1
  23. package/lib/guard-bytes.js +6 -3
  24. package/lib/guard-identifier.js +1 -1
  25. package/lib/guard-intrinsic.js +474 -0
  26. package/lib/http-digest.js +146 -62
  27. package/lib/http-transport.js +82 -17
  28. package/lib/identity-match.js +2 -2
  29. package/lib/merkle.js +2 -2
  30. package/lib/ocsp-request-verify.js +1 -1
  31. package/lib/ocsp.js +46 -22
  32. package/lib/path-validate.js +169 -76
  33. package/lib/pbes2.js +14 -7
  34. package/lib/schema-attrcert.js +2 -2
  35. package/lib/schema-cmc.js +2 -2
  36. package/lib/schema-cmp.js +2 -2
  37. package/lib/schema-cms.js +2 -2
  38. package/lib/schema-crmf.js +2 -2
  39. package/lib/schema-csr.js +2 -2
  40. package/lib/schema-pkix.js +3 -3
  41. package/lib/schema-x509.js +2 -2
  42. package/lib/sigstore.js +1 -1
  43. package/lib/tlog.js +7 -4
  44. package/lib/trust.js +187 -104
  45. package/lib/tsp-sign.js +1 -1
  46. package/lib/webauthn-mds.js +257 -121
  47. package/lib/webauthn.js +327 -164
  48. package/lib/webcrypto.js +10 -3
  49. package/package.json +1 -1
  50. package/sbom.cdx.json +6 -6
package/lib/webcrypto.js CHANGED
@@ -320,7 +320,7 @@ SubtleCrypto.prototype.encryptStream = async function encryptStream(spec, source
320
320
  if (step && step.done) break;
321
321
  var buf = _toBuf(step == null ? undefined : step.value, "encryptStream chunk");
322
322
  var piece = _cipherUpdate(cipher, buf);
323
- if (piece && piece.length) out[out.length] = piece;
323
+ if (piece && piece.length) guard.list.append(out, piece);
324
324
  }
325
325
  } catch (e) {
326
326
  try {
@@ -329,7 +329,11 @@ SubtleCrypto.prototype.encryptStream = async function encryptStream(spec, source
329
329
  } catch (_r) { }
330
330
  throw e;
331
331
  }
332
- out[out.length] = _cipherFinal(cipher);
332
+ /** @internal Each block is appended as an OWN property. An index assignment writes through Set,
333
+ * which walks the prototype for a numeric setter, so an accessor installed there takes the block
334
+ * and the index reads back as its getter's value: the final block carries the padding and, for an
335
+ * AEAD, is what the tag is computed over. */
336
+ guard.list.append(out, _cipherFinal(cipher));
333
337
  return { ciphertext: _bufferConcat(out), tag: spec.authTagLength ? _cipherGetAuthTag(cipher) : null };
334
338
  };
335
339
 
@@ -696,7 +700,10 @@ function _x963Kdf(hashNode, z, sharedInfo, lenBytes) {
696
700
  var blocks = [], counter = 1, got = 0;
697
701
  while (got < lenBytes) {
698
702
  if (counter > 0xffffffff) throw new WebCryptoError("webcrypto/operation", "X963KDF: requested output exceeds the counter range");
699
- var ctr = _bufferAlloc(4); ctr.writeUInt32BE(counter, 0);
703
+ /** @internal The counter block is written with the capture. Each block of the derived key is the
704
+ * hash of the shared secret with this counter in it, so a replaced write makes two blocks derive
705
+ * from the same input and the key material repeats. */
706
+ var ctr = _bufferAlloc(4); intrinsic.writeUInt32BE(ctr, counter, 0);
700
707
  var h = nodeCrypto.createHash(hashNode).update(z).update(ctr).update(sharedInfo).digest();
701
708
  _push(blocks, h); got += h.length; counter += 1;
702
709
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blamejs/pki",
3
- "version": "0.8.55",
3
+ "version": "0.8.56",
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",
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:f7650379-6444-462e-bd4b-7cfbdc879bc7",
5
+ "serialNumber": "urn:uuid:921f4ed0-ec38-4c9d-b490-d6223c040e96",
6
6
  "version": 1,
7
7
  "metadata": {
8
- "timestamp": "2026-10-06T04:32:24.064Z",
8
+ "timestamp": "2026-10-06T23:49:00.685Z",
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.8.55",
22
+ "bom-ref": "@blamejs/pki@0.8.56",
23
23
  "type": "application",
24
24
  "name": "pki",
25
- "version": "0.8.55",
25
+ "version": "0.8.56",
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.8.55",
29
+ "purl": "pkg:npm/%40blamejs/pki@0.8.56",
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.8.55",
57
+ "ref": "@blamejs/pki@0.8.56",
58
58
  "dependsOn": []
59
59
  }
60
60
  ]