@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.
- package/CHANGELOG.md +66 -0
- package/lib/acme.js +2 -2
- package/lib/asn1-der.js +17 -5
- package/lib/attrcert-verify.js +1 -1
- package/lib/cmc-verify.js +1 -1
- package/lib/cmp-session.js +2 -2
- package/lib/cmp-verify.js +2 -2
- package/lib/cms-decrypt.js +4 -1
- package/lib/cms-encrypt.js +4 -1
- package/lib/cms-sign.js +26 -12
- package/lib/cms-verify.js +1 -1
- package/lib/composite-kem.js +30 -12
- package/lib/composite-sig.js +42 -23
- package/lib/constants.js +7 -2
- package/lib/crl-verify.js +1 -1
- package/lib/crmf-sign.js +72 -43
- package/lib/crmf-verify.js +1 -1
- package/lib/csr-verify.js +1 -1
- package/lib/ct.js +2 -2
- package/lib/edwards-point.js +1 -1
- package/lib/est.js +3 -3
- package/lib/guard-async.js +22 -1
- package/lib/guard-bytes.js +6 -3
- package/lib/guard-identifier.js +1 -1
- package/lib/guard-intrinsic.js +474 -0
- package/lib/http-digest.js +146 -62
- package/lib/http-transport.js +82 -17
- package/lib/identity-match.js +2 -2
- package/lib/merkle.js +2 -2
- package/lib/ocsp-request-verify.js +1 -1
- package/lib/ocsp.js +46 -22
- package/lib/path-validate.js +169 -76
- package/lib/pbes2.js +14 -7
- package/lib/schema-attrcert.js +2 -2
- package/lib/schema-cmc.js +2 -2
- package/lib/schema-cmp.js +2 -2
- package/lib/schema-cms.js +2 -2
- package/lib/schema-crmf.js +2 -2
- package/lib/schema-csr.js +2 -2
- package/lib/schema-pkix.js +3 -3
- package/lib/schema-x509.js +2 -2
- package/lib/sigstore.js +1 -1
- package/lib/tlog.js +7 -4
- package/lib/trust.js +187 -104
- package/lib/tsp-sign.js +1 -1
- package/lib/webauthn-mds.js +257 -121
- package/lib/webauthn.js +327 -164
- package/lib/webcrypto.js +10 -3
- package/package.json +1 -1
- package/sbom.cdx.json +6 -6
package/lib/schema-attrcert.js
CHANGED
|
@@ -736,7 +736,7 @@ var decodeExtensions = DOOR.decodeExtensions;
|
|
|
736
736
|
*/
|
|
737
737
|
var decodeExtension = DOOR.decodeExtension;
|
|
738
738
|
|
|
739
|
-
module.exports = {
|
|
739
|
+
module.exports = intrinsic.freeze({
|
|
740
740
|
parse: parse,
|
|
741
741
|
parseV1: parseV1,
|
|
742
742
|
pemDecode: pemDecode,
|
|
@@ -749,4 +749,4 @@ module.exports = {
|
|
|
749
749
|
readGeneralName: readGeneralName,
|
|
750
750
|
validateAttributeValue: validateAttributeValue,
|
|
751
751
|
validateExtensionValue: validateExtensionValue,
|
|
752
|
-
};
|
|
752
|
+
});
|
package/lib/schema-cmc.js
CHANGED
|
@@ -802,7 +802,7 @@ function parse(input, callerOpts) {
|
|
|
802
802
|
return body;
|
|
803
803
|
}
|
|
804
804
|
|
|
805
|
-
module.exports = {
|
|
805
|
+
module.exports = Object.freeze({
|
|
806
806
|
parseEncryptedPop: parseEncryptedPop,
|
|
807
807
|
parseTaggedRequest: parseTaggedRequest,
|
|
808
808
|
parse: parse,
|
|
@@ -810,4 +810,4 @@ module.exports = {
|
|
|
810
810
|
parsePkiResponse: parsePkiResponse,
|
|
811
811
|
STATUS_BY_VALUE: STATUS_BY_VALUE,
|
|
812
812
|
FAIL_INFO_BY_VALUE: FAIL_INFO_BY_VALUE,
|
|
813
|
-
};
|
|
813
|
+
});
|
package/lib/schema-cmp.js
CHANGED
|
@@ -883,7 +883,7 @@ function _readKem(sch, der, code, what) {
|
|
|
883
883
|
function readKemBMParameter(p) { return _readKem(KEM_BM_PARAMETER, p, "cmp/bad-kem-data", "KemBMParameter"); }
|
|
884
884
|
function readKemCiphertextInfo(d) { return _readKem(KEM_CIPHERTEXT_INFO, d, "cmp/bad-kem-ciphertext", "KemCiphertextInfo"); }
|
|
885
885
|
|
|
886
|
-
module.exports = {
|
|
886
|
+
module.exports = Object.freeze({
|
|
887
887
|
parse: parse,
|
|
888
888
|
pemDecode: pemDecode,
|
|
889
889
|
pemEncode: pemEncode,
|
|
@@ -897,4 +897,4 @@ module.exports = {
|
|
|
897
897
|
readName: readName,
|
|
898
898
|
readKemBMParameter: readKemBMParameter,
|
|
899
899
|
readKemCiphertextInfo: readKemCiphertextInfo,
|
|
900
|
-
};
|
|
900
|
+
});
|
package/lib/schema-cms.js
CHANGED
|
@@ -1465,7 +1465,7 @@ function sameAlgorithmModuloDefaults(a, c) {
|
|
|
1465
1465
|
return ak === ck;
|
|
1466
1466
|
}
|
|
1467
1467
|
|
|
1468
|
-
module.exports = {
|
|
1468
|
+
module.exports = Object.freeze({
|
|
1469
1469
|
parse: parse,
|
|
1470
1470
|
parseAlgorithmProtection: parseAlgorithmProtection,
|
|
1471
1471
|
algorithmProtectionReport: algorithmProtectionReport, // @internal
|
|
@@ -1490,4 +1490,4 @@ module.exports = {
|
|
|
1490
1490
|
AEAD_ALGS: AEAD_ALGS,
|
|
1491
1491
|
AEAD_GCM_ICVLENS: AEAD_GCM_ICVLENS,
|
|
1492
1492
|
AEAD_CCM_ICVLENS: AEAD_CCM_ICVLENS,
|
|
1493
|
-
};
|
|
1493
|
+
});
|
package/lib/schema-crmf.js
CHANGED
|
@@ -515,7 +515,7 @@ var decodeExtensions = DOOR.decodeExtensions;
|
|
|
515
515
|
*/
|
|
516
516
|
var decodeExtension = DOOR.decodeExtension;
|
|
517
517
|
|
|
518
|
-
module.exports = {
|
|
518
|
+
module.exports = intrinsic.freeze({
|
|
519
519
|
parse: parse,
|
|
520
520
|
pemDecode: pemDecode,
|
|
521
521
|
pemEncode: pemEncode,
|
|
@@ -525,4 +525,4 @@ module.exports = {
|
|
|
525
525
|
walkCertReqMessages: walkCertReqMessages,
|
|
526
526
|
walkCertTemplate: walkCertTemplate,
|
|
527
527
|
certReqMessagesSchema: CERT_REQ_MESSAGES,
|
|
528
|
-
};
|
|
528
|
+
});
|
package/lib/schema-csr.js
CHANGED
|
@@ -383,7 +383,7 @@ var decodeExtensions = DOOR.decodeExtensions;
|
|
|
383
383
|
*/
|
|
384
384
|
var decodeExtension = DOOR.decodeExtension;
|
|
385
385
|
|
|
386
|
-
module.exports = {
|
|
386
|
+
module.exports = intrinsic.freeze({
|
|
387
387
|
parse: parse,
|
|
388
388
|
pemDecode: pemDecode,
|
|
389
389
|
pemEncode: pemEncode,
|
|
@@ -391,4 +391,4 @@ module.exports = {
|
|
|
391
391
|
decodeExtensions: decodeExtensions,
|
|
392
392
|
decodeExtension: decodeExtension,
|
|
393
393
|
certificationRequestSchema: CERTIFICATION_REQUEST,
|
|
394
|
-
};
|
|
394
|
+
});
|
package/lib/schema-pkix.js
CHANGED
|
@@ -2630,7 +2630,7 @@ function dnsNameProblem(s) {
|
|
|
2630
2630
|
if (_hasWhitespace(s)) return "whitespace";
|
|
2631
2631
|
if (_charAt(s, 0) === "." || _charAt(s, s.length - 1) === ".") return "leading/trailing dot";
|
|
2632
2632
|
if (_strIndexOf(s, "_") !== -1) return "underscore forbidden in dNSName";
|
|
2633
|
-
var labels =
|
|
2633
|
+
var labels = intrinsic.splitChar(s, 46);
|
|
2634
2634
|
for (var i = 0; i < labels.length; i++) {
|
|
2635
2635
|
var label = labels[i];
|
|
2636
2636
|
if (label.length === 0) return "empty label";
|
|
@@ -2644,7 +2644,7 @@ function dnsNameProblem(s) {
|
|
|
2644
2644
|
return null;
|
|
2645
2645
|
}
|
|
2646
2646
|
|
|
2647
|
-
module.exports = {
|
|
2647
|
+
module.exports = intrinsic.freeze({
|
|
2648
2648
|
dnsNameProblem: dnsNameProblem,
|
|
2649
2649
|
pemDecode: pemDecode,
|
|
2650
2650
|
pemDecodeAll: pemDecodeAll,
|
|
@@ -2720,5 +2720,5 @@ module.exports = {
|
|
|
2720
2720
|
attribute: attribute,
|
|
2721
2721
|
extension: extension,
|
|
2722
2722
|
extensions: extensions,
|
|
2723
|
-
};
|
|
2723
|
+
});
|
|
2724
2724
|
|
package/lib/schema-x509.js
CHANGED
|
@@ -337,7 +337,7 @@ var decodeExtensions = DOOR.decodeExtensions;
|
|
|
337
337
|
*/
|
|
338
338
|
var decodeExtension = DOOR.decodeExtension;
|
|
339
339
|
|
|
340
|
-
module.exports = {
|
|
340
|
+
module.exports = intrinsic.freeze({
|
|
341
341
|
parse: parse,
|
|
342
342
|
pemDecode: pemDecode,
|
|
343
343
|
pemEncode: pemEncode,
|
|
@@ -350,4 +350,4 @@ module.exports = {
|
|
|
350
350
|
* Not on the curated `pki.schema.x509` surface. */
|
|
351
351
|
tbsCertificateSchema: TBS_CERTIFICATE_ALONE,
|
|
352
352
|
certificateSchema: CERTIFICATE,
|
|
353
|
-
};
|
|
353
|
+
});
|
package/lib/sigstore.js
CHANGED
|
@@ -1501,7 +1501,7 @@ var SAN_OID = oid.byName("subjectAltName");
|
|
|
1501
1501
|
* reports for a certificate it cannot read, so the fix adds no new code to the public surface. */
|
|
1502
1502
|
var _sanDecoder = pkix.certExtensionDecoders(
|
|
1503
1503
|
pkix.makeNS("x509", frameworkError.CertificateError, oid)).byOid[SAN_OID];
|
|
1504
|
-
var FULCIO_PREFIX = _join(_arraySlice(
|
|
1504
|
+
var FULCIO_PREFIX = _join(_arraySlice(intrinsic.splitChar(oid.byName("otherName"), 46), 0, -1), ".") + ".";
|
|
1505
1505
|
function _identity(leaf) {
|
|
1506
1506
|
var out = { san: null, extensions: _create(null) };
|
|
1507
1507
|
try {
|
package/lib/tlog.js
CHANGED
|
@@ -391,7 +391,7 @@ function parseNote(input) {
|
|
|
391
391
|
var signedBytes = _subarray(buf, 0, end);
|
|
392
392
|
var rest = _bufToString(_subarray(buf, end + 1), "utf8");
|
|
393
393
|
var signatures = [];
|
|
394
|
-
var lines = rest.length === 0 ? [] :
|
|
394
|
+
var lines = rest.length === 0 ? [] : intrinsic.splitChar(rest, 10);
|
|
395
395
|
/** @internal A note ends with a newline, so the split leaves one empty tail element; anything
|
|
396
396
|
* else after it is a line the format does not have. The drop goes through the capture: dispatching
|
|
397
397
|
* through `Array.prototype.pop` let a replacement pop TWICE, taking the last signature line with the
|
|
@@ -603,7 +603,7 @@ function parseCheckpoint(input) {
|
|
|
603
603
|
var note = parseNote(input);
|
|
604
604
|
var text = note.text;
|
|
605
605
|
/** @internal The text ends with a newline, so the split leaves an empty tail that is not a line. */
|
|
606
|
-
var lines =
|
|
606
|
+
var lines = intrinsic.splitChar(text, 10);
|
|
607
607
|
if (lines.length > 0 && lines[lines.length - 1] === "") _pop(lines);
|
|
608
608
|
if (lines.length < MIN_CHECKPOINT_LINES) {
|
|
609
609
|
throw _err("tlog/bad-checkpoint", "a checkpoint body is an origin, a tree size and a root hash, got " +
|
|
@@ -918,7 +918,7 @@ function _segmentDigits(segment, expectX) {
|
|
|
918
918
|
*/
|
|
919
919
|
function parseTilePath(path) {
|
|
920
920
|
if (typeof path !== "string") throw _err("tlog/bad-input", "a tile path is a string");
|
|
921
|
-
var parts =
|
|
921
|
+
var parts = intrinsic.splitChar(path, 47);
|
|
922
922
|
if (parts.length < 3 || parts[0] !== "tile") {
|
|
923
923
|
throw _err("tlog/bad-tile", "a tile path begins tile/<level>/<index>");
|
|
924
924
|
}
|
|
@@ -1034,7 +1034,10 @@ function parseEntryBundle(bytes) {
|
|
|
1034
1034
|
if (p + 2 > buf.length) {
|
|
1035
1035
|
throw _err("tlog/bad-bundle", "a trailing byte at offset " + p + " is not a whole length prefix");
|
|
1036
1036
|
}
|
|
1037
|
-
|
|
1037
|
+
/** @internal The length prefix comes from the capture. It decides where this entry ends and the
|
|
1038
|
+
* next begins, so a replaced reader hands the bounds check below a length the bundle does not
|
|
1039
|
+
* state and the entry that is parsed is a different run of bytes. */
|
|
1040
|
+
var len = intrinsic.readUInt16BE(buf, p);
|
|
1038
1041
|
p += 2;
|
|
1039
1042
|
if (p + len > buf.length) {
|
|
1040
1043
|
throw _err("tlog/bad-bundle", "the entry at offset " + (p - 2) + " declares " + len +
|