@blamejs/pki 0.8.11 → 0.8.14
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 +47 -0
- package/README.md +3 -2
- package/index.js +6 -0
- package/lib/acme.js +13 -5
- package/lib/attrcert-sign.js +3 -3
- package/lib/cmc-build.js +9 -9
- package/lib/cmc-verify.js +5 -5
- package/lib/cmp-build.js +3 -4
- package/lib/cmp-session.js +6 -6
- package/lib/cms-verify.js +4 -4
- package/lib/crl-sign.js +1 -1
- package/lib/crmf-sign.js +1 -1
- package/lib/ct.js +2 -2
- package/lib/est.js +12 -13
- package/lib/framework-error.js +3 -0
- package/lib/guard-header.js +15 -1
- package/lib/guard-identifier.js +34 -0
- package/lib/hpke.js +7 -2
- package/lib/http-transport.js +5 -6
- package/lib/identity-match.js +4 -3
- package/lib/ocsp.js +5 -3
- package/lib/oid.js +1 -1
- package/lib/path-validate.js +380 -111
- package/lib/pki-build.js +1 -1
- package/lib/revocation-fetch.js +1 -1
- package/lib/scep.js +21 -9
- package/lib/schema-all.js +10 -1
- package/lib/schema-engine.js +7 -2
- package/lib/schema-pkix.js +40 -0
- package/lib/schema-trustanchor.js +469 -0
- package/lib/schema-x509.js +66 -33
- package/lib/smime.js +5 -1
- package/lib/trust.js +192 -11
- package/lib/trustanchor-build.js +278 -0
- package/lib/validator-tpm.js +1 -1
- package/lib/webauthn-mds.js +1 -1
- package/lib/webauthn.js +9 -10
- package/lib/webcrypto.js +3 -3
- package/package.json +1 -1
- package/sbom.cdx.json +6 -6
package/lib/guard-identifier.js
CHANGED
|
@@ -100,6 +100,38 @@ function snapshotOptions(obj, known) {
|
|
|
100
100
|
return out;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
/** @internal The option names a bag carries, read the way assertKnownKeys read them: every own
|
|
104
|
+
* string key, whatever its descriptor says. Object.keys reports only the enumerable ones, so an
|
|
105
|
+
* option written with `enumerable: false` clears the door and then vanishes from the read.
|
|
106
|
+
* `known` narrows the result to the declared options. */
|
|
107
|
+
// @enforced-by option-bag-read-by-enumerable-key
|
|
108
|
+
function optionNames(obj, known) {
|
|
109
|
+
if (obj === null || obj === undefined) return [];
|
|
110
|
+
var out = [];
|
|
111
|
+
_forEach(_ownKeys(_Object(obj)), function (k) {
|
|
112
|
+
if (typeof k !== "string") return;
|
|
113
|
+
if (known !== null && known !== undefined && !_hasOwn(known, k)) return;
|
|
114
|
+
_append(out, k);
|
|
115
|
+
});
|
|
116
|
+
return out;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** @internal A caller's options bag copied onto a prototype-less object, keyed by every own string
|
|
120
|
+
* property, not the enumerable ones alone. Each is read once, so an accessor-backed option
|
|
121
|
+
* answers the copy and not the later reads. Inherited properties are left behind: the copy is
|
|
122
|
+
* what the decisions read, and a name reaching it from a prototype is not one the caller set. */
|
|
123
|
+
// @enforced-by option-bag-read-by-enumerable-key
|
|
124
|
+
function ownOptions(obj) {
|
|
125
|
+
var out = _create(null);
|
|
126
|
+
if (obj === null || obj === undefined) return out;
|
|
127
|
+
var o = _Object(obj);
|
|
128
|
+
_forEach(_ownKeys(o), function (k) {
|
|
129
|
+
if (typeof k !== "string") return;
|
|
130
|
+
out[k] = o[k];
|
|
131
|
+
});
|
|
132
|
+
return out;
|
|
133
|
+
}
|
|
134
|
+
|
|
103
135
|
var _PRISTINE_OBJECT_PROTO = (function () {
|
|
104
136
|
var s = _create(null);
|
|
105
137
|
_forEach(["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString",
|
|
@@ -528,6 +560,8 @@ module.exports = intrinsic.freeze({
|
|
|
528
560
|
optionsObject: optionsObject,
|
|
529
561
|
refuseAccessorFields: refuseAccessorFields,
|
|
530
562
|
snapshotOptions: snapshotOptions,
|
|
563
|
+
optionNames: optionNames,
|
|
564
|
+
ownOptions: ownOptions,
|
|
531
565
|
readableNames: readableNames,
|
|
532
566
|
readableIndices: readableIndices
|
|
533
567
|
});
|
package/lib/hpke.js
CHANGED
|
@@ -228,7 +228,11 @@ function _extractAndExpand(kem, dh, kemContext) {
|
|
|
228
228
|
try { return _labeledExpand(kdf, sid, eaePrk, "shared_secret", kemContext, kem.Nsecret); }
|
|
229
229
|
finally { guard.secret.zeroize(eaePrk, HpkeError, "hpke/bad-input", "the KEM extract PRK"); }
|
|
230
230
|
}
|
|
231
|
-
function _kemId(kem) {
|
|
231
|
+
function _kemId(kem) {
|
|
232
|
+
var names = guard.identifier.optionNames(KEMS);
|
|
233
|
+
for (var i = 0; i < names.length; i++) if (KEMS[names[i]] === kem) return Number(names[i]);
|
|
234
|
+
return 0;
|
|
235
|
+
}
|
|
232
236
|
|
|
233
237
|
function _ephemeral(kem, eph) {
|
|
234
238
|
if (eph != null) {
|
|
@@ -429,7 +433,8 @@ var _COMMON_KEYS = intrinsic.assign(intrinsic.create(null), { mode: 1, info: 1,
|
|
|
429
433
|
function _withCommon(extra) {
|
|
430
434
|
var out = intrinsic.create(null);
|
|
431
435
|
Object.keys(_COMMON_KEYS).forEach(function (k) { out[k] = 1; });
|
|
432
|
-
|
|
436
|
+
var en = guard.identifier.optionNames(extra);
|
|
437
|
+
for (var ei = 0; ei < en.length; ei++) out[en[ei]] = 1;
|
|
433
438
|
return out;
|
|
434
439
|
}
|
|
435
440
|
var _SETUP_S_KEYS = _withCommon({
|
package/lib/http-transport.js
CHANGED
|
@@ -279,10 +279,10 @@ function _copyableArray(a) {
|
|
|
279
279
|
function snapshotProxy(p) {
|
|
280
280
|
try {
|
|
281
281
|
if (!_copyableRecord(p)) return p;
|
|
282
|
-
var out =
|
|
283
|
-
if (_copyableRecord(p.auth)) out.auth =
|
|
282
|
+
var out = guard.identifier.ownOptions(p);
|
|
283
|
+
if (_copyableRecord(p.auth)) out.auth = guard.identifier.ownOptions(p.auth);
|
|
284
284
|
if (_copyableRecord(p.tls)) {
|
|
285
|
-
out.tls =
|
|
285
|
+
out.tls = guard.identifier.ownOptions(p.tls);
|
|
286
286
|
var a = p.tls.anchors;
|
|
287
287
|
if (_copyableArray(a)) {
|
|
288
288
|
var copied = [];
|
|
@@ -492,7 +492,7 @@ function httpsTransport(defaults) {
|
|
|
492
492
|
var bodyIsFn = typeof body === "function";
|
|
493
493
|
if (!bodyIsFn && guard.bytes.isByteSource(body)) body = guard.bytes.source(body, E, C("bad-input"), "the request body");
|
|
494
494
|
|
|
495
|
-
var reqHeaders =
|
|
495
|
+
var reqHeaders = guard.identifier.ownOptions(request.headers);
|
|
496
496
|
Object.keys(reqHeaders).forEach(function (k) { var lk = k.toLowerCase(); if (lk === "proxy-authorization" || lk === "proxy-connection") delete reqHeaders[k]; });
|
|
497
497
|
if (bodyIsFn) {
|
|
498
498
|
Object.keys(reqHeaders).forEach(function (k) { var lk = k.toLowerCase(); if (lk === "content-length" || lk === "transfer-encoding" || lk === "expect") delete reqHeaders[k]; });
|
|
@@ -609,8 +609,7 @@ function httpsTransport(defaults) {
|
|
|
609
609
|
if (settled) return;
|
|
610
610
|
settled = true;
|
|
611
611
|
clearTimer();
|
|
612
|
-
var lower =
|
|
613
|
-
Object.keys(res.headers || {}).forEach(function (k) { lower[k.toLowerCase()] = res.headers[k]; });
|
|
612
|
+
var lower = guard.header.lowerCased(res.headers);
|
|
614
613
|
resolve({
|
|
615
614
|
status: res.statusCode,
|
|
616
615
|
headers: lower,
|
package/lib/identity-match.js
CHANGED
|
@@ -199,9 +199,10 @@ function _reference(r, index) {
|
|
|
199
199
|
* afterwards would otherwise name an identity nothing compared. A string is already a value; bytes
|
|
200
200
|
* are the copy taken at the door. */
|
|
201
201
|
function _reported(record) {
|
|
202
|
-
var out = intrinsic.create(null)
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
var out = intrinsic.create(null);
|
|
203
|
+
var names = guard.identifier.optionNames(record);
|
|
204
|
+
for (var i = 0; i < names.length; i++) {
|
|
205
|
+
if (record[names[i]] !== undefined) out[names[i]] = record[names[i]];
|
|
205
206
|
}
|
|
206
207
|
return intrinsic.freeze(out);
|
|
207
208
|
}
|
package/lib/ocsp.js
CHANGED
|
@@ -390,7 +390,10 @@ function _snapshotSignerKey(key, owned) {
|
|
|
390
390
|
return copy;
|
|
391
391
|
}
|
|
392
392
|
if (key && typeof key === "object" && (key.mldsa != null || key.trad != null)) {
|
|
393
|
-
|
|
393
|
+
var ks = guard.identifier.ownOptions(key);
|
|
394
|
+
ks.mldsa = _snapshotSignerKey(key.mldsa, owned);
|
|
395
|
+
ks.trad = _snapshotSignerKey(key.trad, owned);
|
|
396
|
+
return ks;
|
|
394
397
|
}
|
|
395
398
|
return key;
|
|
396
399
|
}
|
|
@@ -925,8 +928,7 @@ function httpRequest(der, responderUrl, opts) {
|
|
|
925
928
|
var HTTP_REQUEST_OPTS = Object.assign(Object.create(null), { method: 1 });
|
|
926
929
|
|
|
927
930
|
function _frozenHeaders(h) {
|
|
928
|
-
var out =
|
|
929
|
-
for (k in h) { if (Object.prototype.hasOwnProperty.call(h, k)) out[k] = h[k]; }
|
|
931
|
+
var out = guard.identifier.ownOptions(h);
|
|
930
932
|
return Object.freeze(out);
|
|
931
933
|
}
|
|
932
934
|
|
package/lib/oid.js
CHANGED
|
@@ -217,7 +217,7 @@ var FAMILIES = Object.assign(Object.create(null), {
|
|
|
217
217
|
hmacWithSHA1: 7, hmacWithSHA224: 8, hmacWithSHA256: 9,
|
|
218
218
|
hmacWithSHA384: 10, hmacWithSHA512: 11 } },
|
|
219
219
|
|
|
220
|
-
smimeCt: { base: [1, 2, 840, 113549, 1, 9, 16, 1], of: { authData: 2, tSTInfo: 4, compressedData: 9, encKeyWithID: 21, authEnvelopedData: 23 } },
|
|
220
|
+
smimeCt: { base: [1, 2, 840, 113549, 1, 9, 16, 1], of: { authData: 2, tSTInfo: 4, compressedData: 9, encKeyWithID: 21, authEnvelopedData: 23, trustAnchorList: 34 } },
|
|
221
221
|
|
|
222
222
|
smimeOri: { base: [1, 2, 840, 113549, 1, 9, 16, 13], of: { kem: 3 } },
|
|
223
223
|
|