micro509 0.12.0 → 0.14.0
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/README.md +78 -30
- package/dist/crypto/crypto.d.ts +73 -0
- package/dist/crypto/crypto.js +74 -0
- package/dist/crypto/crypto.js.map +1 -0
- package/dist/crypto.d.ts +4 -0
- package/dist/crypto.js +2 -0
- package/dist/der/der.d.ts +127 -0
- package/dist/der/der.js +171 -0
- package/dist/der/der.js.map +1 -0
- package/dist/der.d.ts +4 -0
- package/dist/der.js +4 -0
- package/dist/index.d.ts +13 -9
- package/dist/index.js +17 -15
- package/dist/internal/asn1/asn1.d.ts +20 -0
- package/dist/internal/asn1/asn1.js +80 -37
- package/dist/internal/asn1/asn1.js.map +1 -1
- package/dist/internal/asn1/der.d.ts +173 -0
- package/dist/internal/asn1/der.js +116 -38
- package/dist/internal/asn1/der.js.map +1 -1
- package/dist/internal/asn1/oids.js +7 -1
- package/dist/internal/asn1/oids2.js +9 -2
- package/dist/internal/asn1/oids2.js.map +1 -1
- package/dist/internal/crypto/algorithm-names.js +4 -0
- package/dist/internal/crypto/algorithm-names.js.map +1 -1
- package/dist/internal/crypto/pbes2.d.ts +38 -0
- package/dist/internal/crypto/pbes2.js +9 -10
- package/dist/internal/crypto/pbes2.js.map +1 -1
- package/dist/internal/crypto/rsa-pss.js +2 -0
- package/dist/internal/crypto/rsa-pss.js.map +1 -1
- package/dist/internal/crypto/sig-verify.d.ts +31 -0
- package/dist/internal/crypto/sig-verify.js +10 -8
- package/dist/internal/crypto/sig-verify.js.map +1 -1
- package/dist/internal/shared/base64.js +7 -1
- package/dist/internal/shared/base64.js.map +1 -1
- package/dist/internal/shared/dn.d.ts +16 -0
- package/dist/internal/shared/dn.js +149 -12
- package/dist/internal/shared/dn.js.map +1 -1
- package/dist/internal/shared/ip.d.ts +69 -0
- package/dist/internal/shared/ip.js +18 -1
- package/dist/internal/shared/ip.js.map +1 -1
- package/dist/internal/shared/rfc3454-tables.js +1782 -0
- package/dist/internal/shared/rfc3454-tables.js.map +1 -0
- package/dist/internal/verify/name-constraints-engine.js +47 -15
- package/dist/internal/verify/name-constraints-engine.js.map +1 -1
- package/dist/internal/verify/policy-engine.js +85 -94
- package/dist/internal/verify/policy-engine.js.map +1 -1
- package/dist/internal/verify/verify-path.d.ts +7 -0
- package/dist/internal/verify/verify-path.js +49 -45
- package/dist/internal/verify/verify-path.js.map +1 -1
- package/dist/internal/x509/directory-name.js +24 -0
- package/dist/internal/x509/directory-name.js.map +1 -0
- package/dist/internal/x509/extension-bits.js +14 -11
- package/dist/internal/x509/extension-bits.js.map +1 -1
- package/dist/internal/x509/extension-errors.d.ts +6 -0
- package/dist/internal/x509/extension-errors.js +20 -0
- package/dist/internal/x509/extension-errors.js.map +1 -0
- package/dist/internal/x509/extension-registry.js +113 -55
- package/dist/internal/x509/extension-registry.js.map +1 -1
- package/dist/internal/x509/general-name-tags.js +28 -0
- package/dist/internal/x509/general-name-tags.js.map +1 -0
- package/dist/internal/x509/general-name.js +97 -0
- package/dist/internal/x509/general-name.js.map +1 -0
- package/dist/internal/x509/name-fields.js +20 -10
- package/dist/internal/x509/name-fields.js.map +1 -1
- package/dist/keys/keys.d.ts +16 -2
- package/dist/keys/keys.js +311 -170
- package/dist/keys/keys.js.map +1 -1
- package/dist/keys.d.ts +3 -2
- package/dist/keys.js +3 -2
- package/dist/pem/pem.d.ts +3 -2
- package/dist/pem/pem.js +112 -30
- package/dist/pem/pem.js.map +1 -1
- package/dist/pkcs/pkcs12-mac.js +3 -3
- package/dist/pkcs/pkcs12-mac.js.map +1 -1
- package/dist/pkcs/pkcs7.d.ts +85 -21
- package/dist/pkcs/pkcs7.js +261 -186
- package/dist/pkcs/pkcs7.js.map +1 -1
- package/dist/pkcs.d.ts +2 -2
- package/dist/result/result.d.ts +18 -10
- package/dist/result/result.js +20 -12
- package/dist/result/result.js.map +1 -1
- package/dist/result.d.ts +2 -2
- package/dist/result.js +2 -2
- package/dist/revocation/chain.js +154 -103
- package/dist/revocation/chain.js.map +1 -1
- package/dist/revocation/crl.d.ts +13 -2
- package/dist/revocation/crl.js +415 -236
- package/dist/revocation/crl.js.map +1 -1
- package/dist/revocation/ocsp.d.ts +58 -17
- package/dist/revocation/ocsp.js +186 -174
- package/dist/revocation/ocsp.js.map +1 -1
- package/dist/revocation/revocation.d.ts +4 -4
- package/dist/revocation/revocation.js +48 -30
- package/dist/revocation/revocation.js.map +1 -1
- package/dist/revocation.d.ts +4 -4
- package/dist/revocation.js +5 -5
- package/dist/verify/identity.d.ts +2 -1
- package/dist/verify/identity.js +2 -1
- package/dist/verify/identity.js.map +1 -1
- package/dist/verify/policy.d.ts +6 -1
- package/dist/verify/verify.d.ts +18 -3
- package/dist/verify/verify.js +66 -41
- package/dist/verify/verify.js.map +1 -1
- package/dist/verify.d.ts +2 -1
- package/dist/verify.js +4 -3
- package/dist/x509/certificate.d.ts +36 -13
- package/dist/x509/certificate.js +36 -19
- package/dist/x509/certificate.js.map +1 -1
- package/dist/x509/csr.d.ts +6 -3
- package/dist/x509/extensions.d.ts +59 -22
- package/dist/x509/extensions.js +384 -117
- package/dist/x509/extensions.js.map +1 -1
- package/dist/x509/name-text.js +2 -0
- package/dist/x509/name-text.js.map +1 -1
- package/dist/x509/name.d.ts +8 -5
- package/dist/x509/name.js +17 -12
- package/dist/x509/name.js.map +1 -1
- package/dist/x509/parse.d.ts +104 -18
- package/dist/x509/parse.js +127 -163
- package/dist/x509/parse.js.map +1 -1
- package/dist/x509.d.ts +8 -5
- package/dist/x509.js +10 -8
- package/package.json +52 -34
package/dist/verify/verify.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { OIDS as e } from "../internal/asn1/oids2.js";
|
|
2
2
|
import { errorResult as t, indexedErrorResult as n, indexedMicro509Error as r, micro509Error as i } from "../result/result.js";
|
|
3
3
|
import { parseIpAddressToBytes as a } from "../internal/shared/ip.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
4
|
+
import { compareDistinguishedNames as o } from "../internal/shared/dn.js";
|
|
5
|
+
import { parseCertificateDerOrThrow as s, parseCertificateSigningRequestDerOrThrow as c, parseCertificateSigningRequestPemOrThrow as l } from "../x509/parse.js";
|
|
6
|
+
import { verifySignedDataDetailed as u } from "../internal/crypto/sig-verify.js";
|
|
7
|
+
import { createNameConstraintValidationState as d, evaluateNameConstraints as f } from "../internal/verify/name-constraints-engine.js";
|
|
8
|
+
import { createPolicyValidationState as p, evaluatePolicyChain as m } from "../internal/verify/policy-engine.js";
|
|
9
|
+
import { authorityKeyIdentifierMismatch as h, buildChainInternal as g, countCaCertificatesBelowParsed as _, isSelfIssued as v, isWithinValidity as y, loadCertificates as b, loadSingleCertificate as x, verifyCertificateSignature as S } from "../internal/verify/verify-path.js";
|
|
10
|
+
import { matchServiceIdentity as C } from "./identity.js";
|
|
11
|
+
import { checkChainRevocation as w } from "../revocation/chain.js";
|
|
11
12
|
//#region src/verify/verify.ts
|
|
12
13
|
/**
|
|
13
14
|
* Public certificate and CSR verification APIs.
|
|
@@ -30,7 +31,7 @@ import { checkChainRevocation as C } from "../revocation/chain.js";
|
|
|
30
31
|
* Discriminant for every failure a verify operation can produce.
|
|
31
32
|
*
|
|
32
33
|
* - `no_trusted_root` — chain could not be anchored to any root or {@linkcode TrustAnchor}.
|
|
33
|
-
* - `issuer_not_found` — an intermediate's issuer was not in the candidate set.
|
|
34
|
+
* - `issuer_not_found` — an intermediate's issuer was not in the candidate set, or its issuer DN does not match the candidate issuer's subject DN.
|
|
34
35
|
* - `signature_invalid` — a certificate's signature failed cryptographic verification.
|
|
35
36
|
* - `certificate_expired` — a certificate's notBefore/notAfter window excludes the validation time.
|
|
36
37
|
* - `ca_required` — an issuer lacks `basicConstraints.ca = true`.
|
|
@@ -49,10 +50,11 @@ import { checkChainRevocation as C } from "../revocation/chain.js";
|
|
|
49
50
|
* - `unsupported_name_constraints` — a certificate's nameConstraints use an unsupported form.
|
|
50
51
|
* - `name_constraints_violated` — a subject name violates a permitted/excluded subtree.
|
|
51
52
|
* - `unsupported_signature_algorithm_parameters` — the signature algorithm uses unrecognized parameters.
|
|
53
|
+
* - `ec_domain_parameters_missing` — an elliptic curve public key carries no namedCurve domain parameters.
|
|
52
54
|
* - `certificate_revoked` — revocation evidence confirms a chain certificate is revoked.
|
|
53
55
|
* - `revocation_indeterminate` — revocation status could not be determined under a hard-fail policy.
|
|
54
56
|
*/
|
|
55
|
-
const
|
|
57
|
+
const T = [
|
|
56
58
|
"no_trusted_root",
|
|
57
59
|
"issuer_not_found",
|
|
58
60
|
"signature_invalid",
|
|
@@ -73,13 +75,15 @@ const w = [
|
|
|
73
75
|
"unsupported_name_constraints",
|
|
74
76
|
"name_constraints_violated",
|
|
75
77
|
"unsupported_signature_algorithm_parameters",
|
|
78
|
+
"ec_domain_parameters_missing",
|
|
76
79
|
"certificate_revoked",
|
|
77
80
|
"revocation_indeterminate"
|
|
78
|
-
],
|
|
81
|
+
], E = /* @__PURE__ */ new Set([
|
|
79
82
|
e.basicConstraints,
|
|
80
83
|
e.keyUsage,
|
|
81
84
|
e.extendedKeyUsage,
|
|
82
85
|
e.subjectAltName,
|
|
86
|
+
e.issuerAltName,
|
|
83
87
|
e.nameConstraints,
|
|
84
88
|
e.authorityKeyIdentifier,
|
|
85
89
|
e.subjectKeyIdentifier,
|
|
@@ -99,11 +103,11 @@ const w = [
|
|
|
99
103
|
async function buildCandidatePathRaw(e) {
|
|
100
104
|
let t, n, r;
|
|
101
105
|
try {
|
|
102
|
-
t =
|
|
106
|
+
t = x(e.leaf), n = b(e.intermediates ?? []), r = b(e.roots);
|
|
103
107
|
} catch (e) {
|
|
104
108
|
return failure("issuer_not_found", "certificate source is malformed or leaf source does not contain exactly one certificate", 0, detail({ actual: e instanceof Error ? e.message : "certificate source is malformed" }));
|
|
105
109
|
}
|
|
106
|
-
let i = e.trustAnchors ?? [], a = e.at ?? /* @__PURE__ */ new Date(), o = await
|
|
110
|
+
let i = e.trustAnchors ?? [], a = e.at ?? /* @__PURE__ */ new Date(), o = await g(t, n, r, i, a, {
|
|
107
111
|
failure,
|
|
108
112
|
detail
|
|
109
113
|
}), s = o.chain;
|
|
@@ -114,7 +118,8 @@ async function buildCandidatePathRaw(e) {
|
|
|
114
118
|
value: {
|
|
115
119
|
leaf: t,
|
|
116
120
|
chain: s,
|
|
117
|
-
root: c
|
|
121
|
+
root: c,
|
|
122
|
+
anchorCertificateInChain: o.anchorCertificateInChain ?? !0
|
|
118
123
|
}
|
|
119
124
|
};
|
|
120
125
|
}
|
|
@@ -157,17 +162,20 @@ async function validateCandidatePathRaw(e) {
|
|
|
157
162
|
if (!r.ok) return r;
|
|
158
163
|
let i = t[0];
|
|
159
164
|
if (i === void 0) return failure("issuer_not_found", "chain is empty", 0);
|
|
160
|
-
let a = validateSelfSignedLeafAllowed(i, t.length, e);
|
|
165
|
+
let a = await validateSelfSignedLeafAllowed(i, t.length, e);
|
|
161
166
|
if (a !== void 0) return a;
|
|
162
167
|
let o = await validatePathCertificates(t, n);
|
|
163
168
|
if (o !== void 0) return o;
|
|
164
169
|
let s = validatePathLengthConstraints(t);
|
|
165
170
|
if (s !== void 0) return s;
|
|
166
|
-
let c = validatePolicyAndNameConstraints(t, r.value);
|
|
171
|
+
let c = validatePolicyAndNameConstraints(t, r.value, e.anchorCertificateInChain ?? !0);
|
|
167
172
|
return c.ok ? validateLeaf(i, e, c.policyValidation) : c;
|
|
168
173
|
}
|
|
169
|
-
|
|
170
|
-
|
|
174
|
+
/** RFC 5280 §3.2 makes a self-issued certificate self-signed only when the public key it binds verifies its signature. */
|
|
175
|
+
async function validateSelfSignedLeafAllowed(e, t, n) {
|
|
176
|
+
if (t !== 1 || !v(e) || n.allowSelfSignedLeaf === !0) return;
|
|
177
|
+
let r = await S(e, e);
|
|
178
|
+
if (!(!r.ok || !r.valid)) return failure("self_signed_leaf_not_allowed", "self-signed leaf not allowed", 0, detail({ subjectCommonName: e.subject.values.commonName }));
|
|
171
179
|
}
|
|
172
180
|
/** Validates every certificate and issuer relationship in a candidate path. */
|
|
173
181
|
async function validatePathCertificates(e, t) {
|
|
@@ -189,7 +197,7 @@ function validatePathLengthConstraints(e) {
|
|
|
189
197
|
for (let t = 1; t < e.length; t += 1) {
|
|
190
198
|
let n = e[t];
|
|
191
199
|
if (n === void 0) return failure("issuer_not_found", "chain element missing", t);
|
|
192
|
-
let r =
|
|
200
|
+
let r = _(e, t), i = n.basicConstraints?.pathLength;
|
|
193
201
|
if (isNonNegativeInteger(i) && r > i) return pathLengthExceededFailure(n, t, i, r);
|
|
194
202
|
}
|
|
195
203
|
}
|
|
@@ -200,32 +208,48 @@ function pathLengthExceededFailure(e, t, n, r) {
|
|
|
200
208
|
actual: String(r)
|
|
201
209
|
}));
|
|
202
210
|
}
|
|
203
|
-
function validatePolicyAndNameConstraints(e, t) {
|
|
204
|
-
let
|
|
205
|
-
if (!
|
|
206
|
-
expected:
|
|
207
|
-
actual:
|
|
211
|
+
function validatePolicyAndNameConstraints(e, t, n) {
|
|
212
|
+
let r = m(e, t.policy, n);
|
|
213
|
+
if (!r.ok) return failure(r.error.code, r.error.message, 0, detail({
|
|
214
|
+
expected: r.error.details?.expected,
|
|
215
|
+
actual: r.error.details?.actual
|
|
208
216
|
}));
|
|
209
|
-
let
|
|
210
|
-
return
|
|
217
|
+
let i = f(e, t.nameConstraints);
|
|
218
|
+
return i.ok ? {
|
|
211
219
|
ok: !0,
|
|
212
|
-
policyValidation:
|
|
213
|
-
} :
|
|
220
|
+
policyValidation: r.value
|
|
221
|
+
} : i;
|
|
214
222
|
}
|
|
215
223
|
function validateCertificateAtPathIndex(e, t, n) {
|
|
216
|
-
if (!
|
|
224
|
+
if (!y(e, n)) return failure("certificate_expired", "certificate not valid at requested time", t, detail({
|
|
217
225
|
subjectCommonName: e.subject.values.commonName,
|
|
218
226
|
expected: describeDateTime(n),
|
|
219
227
|
actual: `${describeDateTime(e.notBefore)}..${describeDateTime(e.notAfter)}`
|
|
220
228
|
}));
|
|
221
229
|
let r = findUnprocessedCriticalExtension(e);
|
|
222
|
-
|
|
230
|
+
return r === void 0 ? validateEcDomainParametersAtPathIndex(e, t) : failure("unrecognized_critical_extension", `certificate contains unrecognized critical extension ${r}`, t, detail({
|
|
223
231
|
subjectCommonName: e.subject.values.commonName,
|
|
224
232
|
actual: r
|
|
225
233
|
}));
|
|
226
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* RFC 5480 §2.1.1 admits only the namedCurve alternative of ECParameters, and
|
|
237
|
+
* requires clients to reject a certificate whose elliptic curve domain
|
|
238
|
+
* parameters are not present.
|
|
239
|
+
*/
|
|
240
|
+
function validateEcDomainParametersAtPathIndex(t, n) {
|
|
241
|
+
if (t.publicKeyAlgorithmOid === e.ecPublicKey && t.publicKeyParametersOid === void 0) return failure("ec_domain_parameters_missing", "elliptic curve public key carries no namedCurve domain parameters", n, detail({
|
|
242
|
+
subjectCommonName: t.subject.values.commonName,
|
|
243
|
+
expected: "namedCurve OBJECT IDENTIFIER",
|
|
244
|
+
actual: t.publicKeyAlgorithmParametersDer === void 0 ? "absent" : `tag 0x${(t.publicKeyAlgorithmParametersDer[0] ?? 0).toString(16).padStart(2, "0")}`
|
|
245
|
+
}));
|
|
246
|
+
}
|
|
227
247
|
async function validateIssuerAtPathIndex(e, t, n) {
|
|
228
|
-
|
|
248
|
+
if (!o(e.issuer, t.subject)) return failure("issuer_not_found", "issuer distinguished name does not match the candidate issuer subject", n, detail({
|
|
249
|
+
subjectCommonName: e.subject.values.commonName,
|
|
250
|
+
issuerCommonName: t.subject.values.commonName
|
|
251
|
+
}));
|
|
252
|
+
let r = await S(e, t);
|
|
229
253
|
return r.ok ? r.valid ? validateIssuerConstraintsAtPathIndex(e, t, n) : failure("signature_invalid", "certificate signature does not verify", n, detail({
|
|
230
254
|
subjectCommonName: e.subject.values.commonName,
|
|
231
255
|
issuerCommonName: t.subject.values.commonName
|
|
@@ -238,7 +262,7 @@ async function validateIssuerAtPathIndex(e, t, n) {
|
|
|
238
262
|
function validateIssuerConstraintsAtPathIndex(e, t, n) {
|
|
239
263
|
if (t.basicConstraints?.ca !== !0) return failure("ca_required", "issuer must be a CA certificate", n + 1, detail({ subjectCommonName: t.subject.values.commonName }));
|
|
240
264
|
if (t.keyUsage !== void 0 && !t.keyUsage.flags.includes("keyCertSign")) return failure("key_cert_sign_required", "issuer missing keyCertSign", n + 1, detail({ subjectCommonName: t.subject.values.commonName }));
|
|
241
|
-
if (
|
|
265
|
+
if (h(e, t)) return failure("authority_key_identifier_mismatch", "authorityKeyIdentifier does not match issuer subjectKeyIdentifier", n, detail({
|
|
242
266
|
subjectCommonName: e.subject.values.commonName,
|
|
243
267
|
issuerCommonName: t.subject.values.commonName,
|
|
244
268
|
expected: t.subjectKeyIdentifier,
|
|
@@ -296,6 +320,7 @@ async function verifyCertificateChain(e) {
|
|
|
296
320
|
if (!t.ok) return t;
|
|
297
321
|
let n = await validateCandidatePath({
|
|
298
322
|
chain: t.value.chain,
|
|
323
|
+
anchorCertificateInChain: t.value.anchorCertificateInChain,
|
|
299
324
|
...e.at !== void 0 && { at: e.at },
|
|
300
325
|
...e.purpose !== void 0 && { purpose: e.purpose },
|
|
301
326
|
...copyValidationInputs(e),
|
|
@@ -321,7 +346,7 @@ async function verifyCertificateChain(e) {
|
|
|
321
346
|
/** Applies optional revocation evidence to an otherwise verified certificate chain. */
|
|
322
347
|
async function validateVerifiedChainRevocation(e, t) {
|
|
323
348
|
if (e.revocation === void 0) return;
|
|
324
|
-
let n = await
|
|
349
|
+
let n = await w({
|
|
325
350
|
chain: t,
|
|
326
351
|
...e.revocation.crls === void 0 ? {} : { crls: e.revocation.crls },
|
|
327
352
|
...e.revocation.ocspResponses === void 0 ? {} : { ocspResponses: e.revocation.ocspResponses },
|
|
@@ -360,13 +385,13 @@ function revocationFailureResult(e) {
|
|
|
360
385
|
async function verifyCertificateSigningRequest(e) {
|
|
361
386
|
let t;
|
|
362
387
|
try {
|
|
363
|
-
t = typeof e == "string" ?
|
|
388
|
+
t = typeof e == "string" ? l(e) : c(new Uint8Array(e));
|
|
364
389
|
} catch (e) {
|
|
365
390
|
return verifyRequestFailureResult("signature_invalid", "certificate request input is malformed", detail({ actual: e instanceof Error ? e.message : "certificate request input is malformed" }));
|
|
366
391
|
}
|
|
367
392
|
let n;
|
|
368
393
|
try {
|
|
369
|
-
n = await
|
|
394
|
+
n = await u(t.signatureAlgorithmOid, t.signatureAlgorithmParametersDer, t.publicKeyAlgorithmOid, t.publicKeyParametersOid, t.subjectPublicKeyInfoDer, t.signatureValue, t.certificationRequestInfoDer);
|
|
370
395
|
} catch (e) {
|
|
371
396
|
return verifyRequestFailureResult("signature_invalid", "certificate request input is malformed", detail({
|
|
372
397
|
subjectCommonName: t.subject.values.commonName,
|
|
@@ -545,7 +570,7 @@ function validateLeaf(e, t, n) {
|
|
|
545
570
|
function validateServiceIdentity(e, t) {
|
|
546
571
|
let n = validateServiceIdentityInput(t);
|
|
547
572
|
if (!n.ok) return n;
|
|
548
|
-
let r =
|
|
573
|
+
let r = C({
|
|
549
574
|
certificate: reparseCertificateForTrust(e),
|
|
550
575
|
serviceIdentity: t
|
|
551
576
|
});
|
|
@@ -593,8 +618,8 @@ async function verifyChainForExtendedKeyUsageProfile(e, t) {
|
|
|
593
618
|
return n.ok ? applyEkuCheck(n, t) : n;
|
|
594
619
|
}
|
|
595
620
|
/** Returns the OID of the first critical extension not in {@linkcode PROCESSED_EXTENSION_OIDS}, or `undefined`. */
|
|
596
|
-
function findUnprocessedCriticalExtension(
|
|
597
|
-
for (let
|
|
621
|
+
function findUnprocessedCriticalExtension(t) {
|
|
622
|
+
for (let n of t.extensions) if (n.critical && (!E.has(n.oid) || n.oid === e.subjectAltName && t.subjectAltNames?.some((e) => e.type === "unknown") === !0)) return n.oid;
|
|
598
623
|
}
|
|
599
624
|
/** Constructs a {@linkcode VerifyChainFailure} with the given code, message, optional chain index, and details. */
|
|
600
625
|
function failure(e, t, n, i) {
|
|
@@ -622,7 +647,7 @@ function normalizeValidationChain(e) {
|
|
|
622
647
|
return e.map(reparseCertificateForTrust);
|
|
623
648
|
}
|
|
624
649
|
function reparseCertificateForTrust(e) {
|
|
625
|
-
return
|
|
650
|
+
return s(new Uint8Array(e.der));
|
|
626
651
|
}
|
|
627
652
|
/** Returns `true` if the value is a non-negative integer (including zero). */
|
|
628
653
|
function isNonNegativeInteger(e) {
|
|
@@ -709,12 +734,12 @@ function detail(e) {
|
|
|
709
734
|
}
|
|
710
735
|
/** Initializes policy and name-constraint validation state for a chain walk. */
|
|
711
736
|
function buildValidationState(e, t) {
|
|
712
|
-
let n =
|
|
737
|
+
let n = p(resolvePolicyValidationInput(e), t), r = validateInitialNameConstraintsInput(resolveInitialNameConstraintsInput(e));
|
|
713
738
|
return r.ok ? {
|
|
714
739
|
ok: !0,
|
|
715
740
|
value: {
|
|
716
741
|
policy: n,
|
|
717
|
-
nameConstraints:
|
|
742
|
+
nameConstraints: d(r.value)
|
|
718
743
|
}
|
|
719
744
|
} : r;
|
|
720
745
|
}
|
|
@@ -763,6 +788,6 @@ function isRecord(e) {
|
|
|
763
788
|
return typeof e == "object" && !!e;
|
|
764
789
|
}
|
|
765
790
|
//#endregion
|
|
766
|
-
export {
|
|
791
|
+
export { T as VERIFY_ERROR_CODES, buildCandidatePath, checkExtendedKeyUsage, v as isSelfIssuedCertificate, trustAnchorFromCertificate, validateCandidatePath, validateForCa, validateForCodeSigning, validateForTlsClient, validateForTlsServer, verifyCertificateChain, verifyCertificateSigningRequest };
|
|
767
792
|
|
|
768
793
|
//# sourceMappingURL=verify.js.map
|