@tinfoilsh/verifier 1.0.4 → 1.1.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 +4 -3
- package/dist/attestation.d.ts +4 -10
- package/dist/attestation.d.ts.map +1 -1
- package/dist/attestation.js +11 -31
- package/dist/attestation.js.map +1 -1
- package/dist/bundle.d.ts +15 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +128 -0
- package/dist/bundle.js.map +1 -0
- package/dist/cert-verify.d.ts +2 -4
- package/dist/cert-verify.d.ts.map +1 -1
- package/dist/cert-verify.js +12 -16
- package/dist/cert-verify.js.map +1 -1
- package/dist/client.d.ts +0 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +24 -48
- package/dist/client.js.map +1 -1
- package/dist/dcode.d.ts.map +1 -1
- package/dist/dcode.js +3 -2
- package/dist/dcode.js.map +1 -1
- package/dist/errors.d.ts +91 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +102 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/sev/cert-chain.d.ts +1 -2
- package/dist/sev/cert-chain.d.ts.map +1 -1
- package/dist/sev/cert-chain.js +40 -91
- package/dist/sev/cert-chain.js.map +1 -1
- package/dist/sev/constants.d.ts +0 -1
- package/dist/sev/constants.d.ts.map +1 -1
- package/dist/sev/constants.js +1 -1
- package/dist/sev/constants.js.map +1 -1
- package/dist/sev/report.d.ts.map +1 -1
- package/dist/sev/report.js +19 -54
- package/dist/sev/report.js.map +1 -1
- package/dist/sev/utils.d.ts +0 -1
- package/dist/sev/utils.d.ts.map +1 -1
- package/dist/sev/utils.js +1 -1
- package/dist/sev/utils.js.map +1 -1
- package/dist/sev/validation.d.ts.map +1 -1
- package/dist/sev/validation.js +53 -52
- package/dist/sev/validation.js.map +1 -1
- package/dist/sev/verify.d.ts.map +1 -1
- package/dist/sev/verify.js +8 -7
- package/dist/sev/verify.js.map +1 -1
- package/dist/sigstore-trusted-root.d.ts +94 -0
- package/dist/sigstore-trusted-root.d.ts.map +1 -0
- package/dist/sigstore-trusted-root.js +127 -0
- package/dist/sigstore-trusted-root.js.map +1 -0
- package/dist/sigstore.d.ts +5 -4
- package/dist/sigstore.d.ts.map +1 -1
- package/dist/sigstore.js +15 -14
- package/dist/sigstore.js.map +1 -1
- package/dist/types.d.ts +1 -13
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +8 -26
- package/dist/types.js.map +1 -1
- package/package.json +13 -8
- package/dist/github.d.ts +0 -22
- package/dist/github.d.ts.map +0 -1
- package/dist/github.js +0 -69
- package/dist/github.js.map +0 -1
- package/dist/sev/index.d.ts +0 -10
- package/dist/sev/index.d.ts.map +0 -1
- package/dist/sev/index.js +0 -9
- package/dist/sev/index.js.map +0 -1
- package/dist/sigstore-trusted-root.json +0 -126
package/README.md
CHANGED
|
@@ -57,10 +57,11 @@ console.log(doc.securityVerified);
|
|
|
57
57
|
|
|
58
58
|
## Error Handling
|
|
59
59
|
|
|
60
|
-
For callers that want structured error handling, these
|
|
60
|
+
For callers that want structured error handling, these error classes are part of the public API:
|
|
61
61
|
|
|
62
|
-
- `
|
|
63
|
-
- `
|
|
62
|
+
- `ConfigurationError` — client misconfigured (e.g., missing required options)
|
|
63
|
+
- `FetchError` — network or HTTP errors when fetching attestation material
|
|
64
|
+
- `AttestationError` — attestation verification failed (parsing, signatures, certificates, measurement mismatch, policy violation)
|
|
64
65
|
|
|
65
66
|
## Inspecting Verification Results
|
|
66
67
|
|
package/dist/attestation.d.ts
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import type { AttestationDocument, AttestationResponse } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Retrieves the attestation document from a given enclave hostname.
|
|
4
|
-
*
|
|
5
|
-
* @param host - The hostname of the enclave
|
|
6
|
-
* @returns The attestation document
|
|
7
|
-
* @throws Error if the request fails
|
|
8
|
-
*/
|
|
9
|
-
export declare function fetchAttestation(host: string): Promise<AttestationDocument>;
|
|
10
2
|
/**
|
|
11
3
|
* Checks the attestation document against its trust root
|
|
12
4
|
* and returns the inner measurements.
|
|
13
5
|
*
|
|
14
6
|
* @param doc - The attestation document to verify
|
|
15
|
-
* @param vcekBase64 -
|
|
7
|
+
* @param vcekBase64 - VCEK certificate in base64-encoded DER format
|
|
16
8
|
* @returns The verification result
|
|
17
9
|
* @throws Error if verification fails or format is unsupported
|
|
18
10
|
*/
|
|
19
|
-
export declare function verifyAttestation(doc: AttestationDocument, vcekBase64
|
|
11
|
+
export declare function verifyAttestation(doc: AttestationDocument, vcekBase64: string): Promise<AttestationResponse>;
|
|
12
|
+
export declare function base64ToBytes(base64: string): Uint8Array;
|
|
13
|
+
export declare function decompressGzip(data: Uint8Array): Promise<Uint8Array>;
|
|
20
14
|
//# sourceMappingURL=attestation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attestation.d.ts","sourceRoot":"","sources":["../src/attestation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"attestation.d.ts","sourceRoot":"","sources":["../src/attestation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAS3E;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAMlH;AA+ED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAOxD;AAED,wBAAsB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAgB1E"}
|
package/dist/attestation.js
CHANGED
|
@@ -4,42 +4,22 @@ import { CertificateChain } from './sev/cert-chain.js';
|
|
|
4
4
|
import { verifyAttestation as verifyAttestationInternal } from './sev/verify.js';
|
|
5
5
|
import { bytesToHex } from './sev/utils.js';
|
|
6
6
|
import { validateReport, defaultValidationOptions } from './sev/validation.js';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Retrieves the attestation document from a given enclave hostname.
|
|
10
|
-
*
|
|
11
|
-
* @param host - The hostname of the enclave
|
|
12
|
-
* @returns The attestation document
|
|
13
|
-
* @throws Error if the request fails
|
|
14
|
-
*/
|
|
15
|
-
export async function fetchAttestation(host) {
|
|
16
|
-
const url = `https://${host}${ATTESTATION_ENDPOINT}`;
|
|
17
|
-
const response = await fetch(url);
|
|
18
|
-
if (!response.ok) {
|
|
19
|
-
throw new Error(`Failed to fetch attestation: ${response.status} ${response.statusText}`);
|
|
20
|
-
}
|
|
21
|
-
const docDict = await response.json();
|
|
22
|
-
return {
|
|
23
|
-
format: docDict.format,
|
|
24
|
-
body: docDict.body,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
7
|
+
import { AttestationError, wrapOrThrow } from './errors.js';
|
|
27
8
|
/**
|
|
28
9
|
* Checks the attestation document against its trust root
|
|
29
10
|
* and returns the inner measurements.
|
|
30
11
|
*
|
|
31
12
|
* @param doc - The attestation document to verify
|
|
32
|
-
* @param vcekBase64 -
|
|
13
|
+
* @param vcekBase64 - VCEK certificate in base64-encoded DER format
|
|
33
14
|
* @returns The verification result
|
|
34
15
|
* @throws Error if verification fails or format is unsupported
|
|
35
16
|
*/
|
|
36
17
|
export async function verifyAttestation(doc, vcekBase64) {
|
|
37
18
|
if (doc.format === PredicateType.SevGuestV2) {
|
|
38
|
-
|
|
39
|
-
return verifySevAttestationV2(doc.body, vcekDer);
|
|
19
|
+
return verifySevAttestationV2(doc.body, base64ToBytes(vcekBase64));
|
|
40
20
|
}
|
|
41
21
|
else {
|
|
42
|
-
throw new
|
|
22
|
+
throw new AttestationError(`Unsupported attestation document format: "${doc.format}". Only SEV-SNP Guest V2 format is supported`);
|
|
43
23
|
}
|
|
44
24
|
}
|
|
45
25
|
/**
|
|
@@ -80,7 +60,7 @@ async function verifySevReport(attestationDoc, isCompressed, vcekDer) {
|
|
|
80
60
|
attDocBytes = base64ToBytes(attestationDoc);
|
|
81
61
|
}
|
|
82
62
|
catch (e) {
|
|
83
|
-
throw new
|
|
63
|
+
throw new AttestationError('Failed to decode attestation document: Invalid base64 encoding', { cause: e });
|
|
84
64
|
}
|
|
85
65
|
if (isCompressed) {
|
|
86
66
|
attDocBytes = await decompressGzip(attDocBytes);
|
|
@@ -90,7 +70,7 @@ async function verifySevReport(attestationDoc, isCompressed, vcekDer) {
|
|
|
90
70
|
report = new Report(attDocBytes);
|
|
91
71
|
}
|
|
92
72
|
catch (e) {
|
|
93
|
-
throw new
|
|
73
|
+
throw new AttestationError('Failed to parse SEV-SNP attestation report', { cause: e });
|
|
94
74
|
}
|
|
95
75
|
const chain = await CertificateChain.fromReport(report, vcekDer);
|
|
96
76
|
let res;
|
|
@@ -98,20 +78,20 @@ async function verifySevReport(attestationDoc, isCompressed, vcekDer) {
|
|
|
98
78
|
res = await verifyAttestationInternal(chain, report);
|
|
99
79
|
}
|
|
100
80
|
catch (e) {
|
|
101
|
-
|
|
81
|
+
wrapOrThrow(e, AttestationError, 'Attestation cryptographic verification failed');
|
|
102
82
|
}
|
|
103
83
|
if (!res) {
|
|
104
|
-
throw new
|
|
84
|
+
throw new AttestationError('Attestation verification failed: Report signature or certificate chain is invalid');
|
|
105
85
|
}
|
|
106
86
|
try {
|
|
107
87
|
validateReport(report, chain, defaultValidationOptions);
|
|
108
88
|
}
|
|
109
89
|
catch (e) {
|
|
110
|
-
|
|
90
|
+
wrapOrThrow(e, AttestationError, 'Attestation policy validation failed');
|
|
111
91
|
}
|
|
112
92
|
return report;
|
|
113
93
|
}
|
|
114
|
-
function base64ToBytes(base64) {
|
|
94
|
+
export function base64ToBytes(base64) {
|
|
115
95
|
const binaryString = atob(base64);
|
|
116
96
|
const bytes = new Uint8Array(binaryString.length);
|
|
117
97
|
for (let i = 0; i < binaryString.length; i++) {
|
|
@@ -119,7 +99,7 @@ function base64ToBytes(base64) {
|
|
|
119
99
|
}
|
|
120
100
|
return bytes;
|
|
121
101
|
}
|
|
122
|
-
async function decompressGzip(data) {
|
|
102
|
+
export async function decompressGzip(data) {
|
|
123
103
|
// Use DecompressionStream if available (browsers, Node.js 18+)
|
|
124
104
|
if (typeof DecompressionStream !== 'undefined') {
|
|
125
105
|
const stream = new Response(data.buffer).body;
|
package/dist/attestation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attestation.js","sourceRoot":"","sources":["../src/attestation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,iBAAiB,IAAI,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"attestation.js","sourceRoot":"","sources":["../src/attestation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,iBAAiB,IAAI,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO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AAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7C,KAAK,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAgB;IACnD,+DAA+D;IAC/D,IAAI,OAAO,mBAAmB,KAAK,WAAW,EAAE,CAAC;QAC/C,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAqB,CAAC,CAAC,IAAI,CAAC;QAC7D,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;QACvD,CAAC;QAED,MAAM,kBAAkB,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC;QAC/E,MAAM,YAAY,GAAG,MAAM,IAAI,QAAQ,CAAC,kBAAkB,CAAC,CAAC,WAAW,EAAE,CAAC;QAC1E,OAAO,IAAI,UAAU,CAAC,YAAY,CAAC,CAAC;IACtC,CAAC;IAED,+BAA+B;IAC/B,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5C,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1C,CAAC"}
|
package/dist/bundle.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundle assembler — fetches all attestation components and packages them
|
|
3
|
+
* into an AttestationBundle for verification.
|
|
4
|
+
*/
|
|
5
|
+
import type { AttestationBundle } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Assemble a complete attestation bundle by fetching all components
|
|
8
|
+
* directly from the enclave and public infrastructure.
|
|
9
|
+
* Each network call is retried up to 2 times on transient failure.
|
|
10
|
+
*
|
|
11
|
+
* @throws FetchError on I/O failure (after retries)
|
|
12
|
+
* @throws AttestationError if the attestation report cannot be parsed
|
|
13
|
+
*/
|
|
14
|
+
export declare function assembleAttestationBundle(enclaveHost: string, configRepo: string): Promise<AttestationBundle>;
|
|
15
|
+
//# sourceMappingURL=bundle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,KAAK,EAAE,iBAAiB,EAAuB,MAAM,YAAY,CAAC;AAMzE;;;;;;;GAOG;AACH,wBAAsB,yBAAyB,CAC7C,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAuD5B"}
|
package/dist/bundle.js
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundle assembler — fetches all attestation components and packages them
|
|
3
|
+
* into an AttestationBundle for verification.
|
|
4
|
+
*/
|
|
5
|
+
import { base64ToBytes, decompressGzip } from './attestation.js';
|
|
6
|
+
import { Report } from './sev/report.js';
|
|
7
|
+
import { tcbFromInt, bytesToHex } from './sev/utils.js';
|
|
8
|
+
import { AttestationError, FetchError, wrapOrThrow } from './errors.js';
|
|
9
|
+
import { PredicateType } from './types.js';
|
|
10
|
+
const GITHUB_API = 'https://api-github-proxy.tinfoil.sh';
|
|
11
|
+
const GITHUB_DL = 'https://github-proxy.tinfoil.sh';
|
|
12
|
+
const KDS = 'https://kds-proxy.tinfoil.sh';
|
|
13
|
+
/**
|
|
14
|
+
* Assemble a complete attestation bundle by fetching all components
|
|
15
|
+
* directly from the enclave and public infrastructure.
|
|
16
|
+
* Each network call is retried up to 2 times on transient failure.
|
|
17
|
+
*
|
|
18
|
+
* @throws FetchError on I/O failure (after retries)
|
|
19
|
+
* @throws AttestationError if the attestation report cannot be parsed
|
|
20
|
+
*/
|
|
21
|
+
export async function assembleAttestationBundle(enclaveHost, configRepo) {
|
|
22
|
+
// 1. Fetch independent resources in parallel
|
|
23
|
+
const [attestation, digest, enclaveCert] = await Promise.all([
|
|
24
|
+
withRetry(async () => {
|
|
25
|
+
const doc = await fetchJson(`https://${enclaveHost}/.well-known/tinfoil-attestation`);
|
|
26
|
+
return { format: doc.format, body: doc.body };
|
|
27
|
+
}),
|
|
28
|
+
withRetry(async () => {
|
|
29
|
+
const { tag_name } = await fetchJson(`${GITHUB_API}/repos/${configRepo}/releases/latest`);
|
|
30
|
+
return (await fetchText(`${GITHUB_DL}/${configRepo}/releases/download/${tag_name}/tinfoil.hash`)).trim();
|
|
31
|
+
}),
|
|
32
|
+
withRetry(async () => {
|
|
33
|
+
const data = await fetchJson(`https://${enclaveHost}/.well-known/tinfoil-certificate`);
|
|
34
|
+
return data.certificate;
|
|
35
|
+
}),
|
|
36
|
+
]);
|
|
37
|
+
// 2. Fetch Sigstore bundle (needs digest)
|
|
38
|
+
const sigstoreBundle = await withRetry(async () => {
|
|
39
|
+
const data = await fetchJson(`${GITHUB_API}/repos/${configRepo}/attestations/sha256:${digest}`);
|
|
40
|
+
if (!data.attestations?.[0]?.bundle) {
|
|
41
|
+
throw new FetchError(`No Sigstore bundle for ${configRepo} at digest ${digest}`);
|
|
42
|
+
}
|
|
43
|
+
return data.attestations[0].bundle;
|
|
44
|
+
});
|
|
45
|
+
// 3. Parse attestation report
|
|
46
|
+
let report;
|
|
47
|
+
try {
|
|
48
|
+
report = new Report(await decompressGzip(base64ToBytes(attestation.body)));
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
wrapOrThrow(e, AttestationError, 'Failed to parse attestation report');
|
|
52
|
+
}
|
|
53
|
+
// 4. Fetch VCEK certificate from AMD KDS (needs parsed report)
|
|
54
|
+
const vcek = await withRetry(async () => {
|
|
55
|
+
const tcb = tcbFromInt(report.reportedTcb);
|
|
56
|
+
const chip = bytesToHex(report.chipId);
|
|
57
|
+
const der = await fetchBinary(`${KDS}/vcek/v1/${report.productName}/${chip}?blSPL=${tcb.blSpl}&teeSPL=${tcb.teeSpl}&snpSPL=${tcb.snpSpl}&ucodeSPL=${tcb.ucodeSpl}`);
|
|
58
|
+
let bin = '';
|
|
59
|
+
for (let i = 0; i < der.length; i++)
|
|
60
|
+
bin += String.fromCharCode(der[i]);
|
|
61
|
+
return btoa(bin);
|
|
62
|
+
});
|
|
63
|
+
return {
|
|
64
|
+
domain: enclaveHost,
|
|
65
|
+
enclaveAttestationReport: attestation,
|
|
66
|
+
digest,
|
|
67
|
+
sigstoreBundle,
|
|
68
|
+
vcek,
|
|
69
|
+
enclaveCert,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
// ---------------------------------------------------------------------------
|
|
73
|
+
// Retry and typed fetch helpers
|
|
74
|
+
// ---------------------------------------------------------------------------
|
|
75
|
+
const MAX_RETRIES = 2;
|
|
76
|
+
/** Retry on transient FetchError with exponential backoff (0.5s, 1s, 2s). */
|
|
77
|
+
async function withRetry(fn) {
|
|
78
|
+
for (let i = 0; i <= MAX_RETRIES; i++) {
|
|
79
|
+
try {
|
|
80
|
+
return await fn();
|
|
81
|
+
}
|
|
82
|
+
catch (e) {
|
|
83
|
+
if (i === MAX_RETRIES || !(e instanceof FetchError))
|
|
84
|
+
throw e;
|
|
85
|
+
}
|
|
86
|
+
await new Promise(r => setTimeout(r, 500 * Math.pow(2, i)));
|
|
87
|
+
}
|
|
88
|
+
throw new Error('unreachable');
|
|
89
|
+
}
|
|
90
|
+
/** Fetch a URL, throwing FetchError on non-OK or network failure. */
|
|
91
|
+
async function fetchOk(url) {
|
|
92
|
+
let response;
|
|
93
|
+
try {
|
|
94
|
+
response = await fetch(url);
|
|
95
|
+
}
|
|
96
|
+
catch (e) {
|
|
97
|
+
throw new FetchError(`Network error: ${url}`, { cause: e });
|
|
98
|
+
}
|
|
99
|
+
if (!response.ok) {
|
|
100
|
+
throw new FetchError(`HTTP ${response.status}: ${url}`);
|
|
101
|
+
}
|
|
102
|
+
return response;
|
|
103
|
+
}
|
|
104
|
+
async function fetchJson(url) {
|
|
105
|
+
try {
|
|
106
|
+
return await (await fetchOk(url)).json();
|
|
107
|
+
}
|
|
108
|
+
catch (e) {
|
|
109
|
+
wrapOrThrow(e, FetchError, `Invalid response from ${url}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
async function fetchText(url) {
|
|
113
|
+
try {
|
|
114
|
+
return await (await fetchOk(url)).text();
|
|
115
|
+
}
|
|
116
|
+
catch (e) {
|
|
117
|
+
wrapOrThrow(e, FetchError, `Invalid response from ${url}`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async function fetchBinary(url) {
|
|
121
|
+
try {
|
|
122
|
+
return new Uint8Array(await (await fetchOk(url)).arrayBuffer());
|
|
123
|
+
}
|
|
124
|
+
catch (e) {
|
|
125
|
+
wrapOrThrow(e, FetchError, `Invalid response from ${url}`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3C,MAAM,UAAU,GAAG,qCAAqC,CAAC;AACzD,MAAM,SAAS,GAAG,iCAAiC,CAAC;AACpD,MAAM,GAAG,GAAG,8BAA8B,C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C;IAAC,CAAC;IACjD,OAAO,CAAC,EAAE,CAAC;QAAC,WAAW,CAAC,CAAC,EAAE,UAAU,EAAE,yBAAyB,GAAG,EAAE,CAAC,CAAC;IAAC,CAAC;AAC3E,CAAC;AAED,KAAK,UAAU,SAAS,CAAC,GAAW;IAClC,IAAI,CAAC;QAAC,OAAO,MAAM,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAAC,CAAC;IACjD,OAAO,CAAC,EAAE,CAAC;QAAC,WAAW,CAAC,CAAC,EAAE,UAAU,EAAE,yBAAyB,GAAG,EAAE,CAAC,CAAC;IAAC,CAAC;AAC3E,CAAC;AAED,KAAK,UAAU,WAAW,CAAC,GAAW;IACpC,IAAI,CAAC;QAAC,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IAAC,CAAC;IACxE,OAAO,CAAC,EAAE,CAAC;QAAC,WAAW,CAAC,CAAC,EAAE,UAAU,EAAE,yBAAyB,GAAG,EAAE,CAAC,CAAC;IAAC,CAAC;AAC3E,CAAC"}
|
package/dist/cert-verify.d.ts
CHANGED
|
@@ -15,9 +15,6 @@ export interface CertVerificationResult {
|
|
|
15
15
|
/** DNS names from certificate SANs */
|
|
16
16
|
dnsNames: string[];
|
|
17
17
|
}
|
|
18
|
-
export declare class CertificateVerificationError extends Error {
|
|
19
|
-
constructor(message: string);
|
|
20
|
-
}
|
|
21
18
|
/**
|
|
22
19
|
* Verify enclave TLS certificate.
|
|
23
20
|
*
|
|
@@ -26,7 +23,8 @@ export declare class CertificateVerificationError extends Error {
|
|
|
26
23
|
* @param attestationDoc - Attestation document to verify hash against
|
|
27
24
|
* @param expectedHpkeKey - Expected HPKE public key (hex)
|
|
28
25
|
* @returns Verification result with extracted values
|
|
29
|
-
* @throws
|
|
26
|
+
* @throws AttestationError if certificate parsing or decoding fails
|
|
27
|
+
* @throws AttestationError if certificate values don't match expected values
|
|
30
28
|
*/
|
|
31
29
|
export declare function verifyCertificate(certPem: string, expectedDomain: string, attestationDoc: AttestationDocument, expectedHpkeKey: string): Promise<CertVerificationResult>;
|
|
32
30
|
//# sourceMappingURL=cert-verify.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cert-verify.d.ts","sourceRoot":"","sources":["../src/cert-verify.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"cert-verify.d.ts","sourceRoot":"","sources":["../src/cert-verify.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AA4DtD,MAAM,WAAW,sBAAsB;IACrC,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,eAAe,EAAE,MAAM,CAAC;IACxB,sCAAsC;IACtC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,mBAAmB,EACnC,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,sBAAsB,CAAC,CA+EjC"}
|
package/dist/cert-verify.js
CHANGED
|
@@ -10,6 +10,7 @@ import { X509Certificate } from '@freedomofpress/sigstore-browser';
|
|
|
10
10
|
import { ASN1Obj } from '@freedomofpress/crypto-browser';
|
|
11
11
|
import { decodeDomains, bytesToHex } from './dcode.js';
|
|
12
12
|
import { hashAttestationDocument } from './types.js';
|
|
13
|
+
import { AttestationError } from './errors.js';
|
|
13
14
|
/**
|
|
14
15
|
* Extract DNS names from Subject Alternative Name extension
|
|
15
16
|
* Uses ASN1Obj parser for proper ASN.1 handling
|
|
@@ -59,12 +60,6 @@ function domainMatchesSans(sans, expectedDomain) {
|
|
|
59
60
|
}
|
|
60
61
|
return false;
|
|
61
62
|
}
|
|
62
|
-
export class CertificateVerificationError extends Error {
|
|
63
|
-
constructor(message) {
|
|
64
|
-
super(message);
|
|
65
|
-
this.name = 'CertificateVerificationError';
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
63
|
/**
|
|
69
64
|
* Verify enclave TLS certificate.
|
|
70
65
|
*
|
|
@@ -73,7 +68,8 @@ export class CertificateVerificationError extends Error {
|
|
|
73
68
|
* @param attestationDoc - Attestation document to verify hash against
|
|
74
69
|
* @param expectedHpkeKey - Expected HPKE public key (hex)
|
|
75
70
|
* @returns Verification result with extracted values
|
|
76
|
-
* @throws
|
|
71
|
+
* @throws AttestationError if certificate parsing or decoding fails
|
|
72
|
+
* @throws AttestationError if certificate values don't match expected values
|
|
77
73
|
*/
|
|
78
74
|
export async function verifyCertificate(certPem, expectedDomain, attestationDoc, expectedHpkeKey) {
|
|
79
75
|
// 1. Parse PEM certificate
|
|
@@ -82,50 +78,50 @@ export async function verifyCertificate(certPem, expectedDomain, attestationDoc,
|
|
|
82
78
|
cert = X509Certificate.parse(certPem);
|
|
83
79
|
}
|
|
84
80
|
catch (error) {
|
|
85
|
-
throw new
|
|
81
|
+
throw new AttestationError(`Failed to parse enclave TLS certificate: ${error.message}`, { cause: error });
|
|
86
82
|
}
|
|
87
83
|
// 2. Extract SANs
|
|
88
84
|
const sans = extractSANs(cert);
|
|
89
85
|
if (sans.length === 0) {
|
|
90
|
-
throw new
|
|
86
|
+
throw new AttestationError('Invalid enclave certificate: No Subject Alternative Names found');
|
|
91
87
|
}
|
|
92
88
|
// 3. Verify domain
|
|
93
89
|
if (!domainMatchesSans(sans, expectedDomain)) {
|
|
94
|
-
throw new
|
|
90
|
+
throw new AttestationError(`Certificate domain mismatch: Certificate is not valid for "${expectedDomain}"`);
|
|
95
91
|
}
|
|
96
92
|
// 4. Extract and verify HPKE key
|
|
97
93
|
const hpkeSans = sans.filter(s => s.includes('.hpke.'));
|
|
98
94
|
if (hpkeSans.length === 0) {
|
|
99
|
-
throw new
|
|
95
|
+
throw new AttestationError('Invalid enclave certificate: No HPKE key embedded in Subject Alternative Names');
|
|
100
96
|
}
|
|
101
97
|
let hpkeKeyBytes;
|
|
102
98
|
try {
|
|
103
99
|
hpkeKeyBytes = decodeDomains(hpkeSans, 'hpke');
|
|
104
100
|
}
|
|
105
101
|
catch (error) {
|
|
106
|
-
throw new
|
|
102
|
+
throw new AttestationError(`Failed to extract HPKE key from certificate: ${error.message}`, { cause: error });
|
|
107
103
|
}
|
|
108
104
|
const hpkePublicKey = bytesToHex(hpkeKeyBytes);
|
|
109
105
|
if (hpkePublicKey !== expectedHpkeKey) {
|
|
110
|
-
throw new
|
|
106
|
+
throw new AttestationError('HPKE key mismatch: The encryption key in the certificate does not match the attested key');
|
|
111
107
|
}
|
|
112
108
|
// 5. Extract and verify attestation hash
|
|
113
109
|
const hattSans = sans.filter(s => s.includes('.hatt.'));
|
|
114
110
|
if (hattSans.length === 0) {
|
|
115
|
-
throw new
|
|
111
|
+
throw new AttestationError('Invalid enclave certificate: No attestation hash embedded in Subject Alternative Names');
|
|
116
112
|
}
|
|
117
113
|
let hashBytes;
|
|
118
114
|
try {
|
|
119
115
|
hashBytes = decodeDomains(hattSans, 'hatt');
|
|
120
116
|
}
|
|
121
117
|
catch (error) {
|
|
122
|
-
throw new
|
|
118
|
+
throw new AttestationError(`Failed to extract attestation hash from certificate: ${error.message}`, { cause: error });
|
|
123
119
|
}
|
|
124
120
|
// The hash is stored as the hex string bytes
|
|
125
121
|
const certAttestationHash = new TextDecoder().decode(hashBytes);
|
|
126
122
|
const computedHash = await hashAttestationDocument(attestationDoc);
|
|
127
123
|
if (certAttestationHash !== computedHash) {
|
|
128
|
-
throw new
|
|
124
|
+
throw new AttestationError('Attestation hash mismatch: The hash in the certificate does not match the attestation document');
|
|
129
125
|
}
|
|
130
126
|
return {
|
|
131
127
|
hpkePublicKey,
|
package/dist/cert-verify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cert-verify.js","sourceRoot":"","sources":["../src/cert-verify.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"cert-verify.js","sourceRoot":"","sources":["../src/cert-verify.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C;;;GAGG;AACH,SAAS,WAAW,CAAC,IAAqB;IACxC,sDAAsD;IACtD,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACjD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAErD,+DAA+D;IAC/D,KAAK,MAAM,WAAW,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACpC,iDAAiD;QACjD,IAAI,WAAW,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;YACjE,IAA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CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IACxD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,gBAAgB,CAAC,wFAAwF,CAAC,CAAC;IACvH,CAAC;IAED,IAAI,SAAqB,CAAC;IAC1B,IAAI,CAAC;QACH,SAAS,GAAG,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,gBAAgB,CACxB,wDAAyD,KAAe,CAAC,OAAO,EAAE,EAClF,EAAE,KAAK,EAAE,KAAc,EAAE,CAC1B,CAAC;IACJ,CAAC;IAED,6CAA6C;IAC7C,MAAM,mBAAmB,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAChE,MAAM,YAAY,GAAG,MAAM,uBAAuB,CAAC,cAAc,CAAC,CAAC;IAEnE,IAAI,mBAAmB,KAAK,YAAY,EAAE,CAAC;QACzC,MAAM,IAAI,gBAAgB,CACxB,gGAAgG,CACjG,CAAC;IACJ,CAAC;IAED,OAAO;QACL,aAAa;QACb,eAAe,EAAE,YAAY;QAC7B,QAAQ,EAAE,IAAI;KACf,CAAC;AACJ,CAAC"}
|
package/dist/client.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ export declare class Verifier {
|
|
|
11
11
|
constructor(options: VerifierOptions);
|
|
12
12
|
verify(): Promise<AttestationResponse>;
|
|
13
13
|
verifyBundle(bundle: AttestationBundle): Promise<AttestationResponse>;
|
|
14
|
-
private performVerification;
|
|
15
14
|
private saveFailedVerificationDocument;
|
|
16
15
|
getVerificationDocument(): VerificationDocument | undefined;
|
|
17
16
|
}
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAG/F,MAAM,WAAW,eAAe;IAC9B,6GAA6G;IAC7G,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,QAAQ;IACnB,OAAO,CAAC,SAAS,CAAC,CAAS;IAC3B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,oBAAoB,CAAC,CAAuB;gBAExC,OAAO,EAAE,eAAe;IAQ9B,MAAM,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAStC,YAAY,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAoF3E,OAAO,CAAC,8BAA8B;IAiBtC,uBAAuB,IAAI,oBAAoB,GAAG,SAAS;CAG5D"}
|
package/dist/client.js
CHANGED
|
@@ -1,42 +1,33 @@
|
|
|
1
|
-
import { verifyAttestation as verifyAmdAttestation
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { verifyCertificate
|
|
5
|
-
import { compareMeasurements,
|
|
1
|
+
import { verifyAttestation as verifyAmdAttestation } from './attestation.js';
|
|
2
|
+
import { verifySigstoreBundle } from './sigstore.js';
|
|
3
|
+
import { assembleAttestationBundle } from './bundle.js';
|
|
4
|
+
import { verifyCertificate } from './cert-verify.js';
|
|
5
|
+
import { compareMeasurements, measurementFingerprint } from './types.js';
|
|
6
|
+
import { ConfigurationError } from './errors.js';
|
|
6
7
|
export class Verifier {
|
|
7
|
-
serverURL;
|
|
8
|
-
configRepo;
|
|
9
|
-
verificationDocument;
|
|
10
8
|
constructor(options) {
|
|
11
9
|
if (!options.configRepo) {
|
|
12
|
-
throw new
|
|
10
|
+
throw new ConfigurationError("configRepo is required for Verifier");
|
|
13
11
|
}
|
|
14
12
|
this.serverURL = options.serverURL;
|
|
15
13
|
this.configRepo = options.configRepo;
|
|
16
14
|
}
|
|
17
15
|
async verify() {
|
|
18
16
|
if (!this.serverURL) {
|
|
19
|
-
throw new
|
|
17
|
+
throw new ConfigurationError("serverURL is required for verify(). Use verifyBundle() with an attestation bundle instead.");
|
|
20
18
|
}
|
|
21
19
|
const domain = new URL(this.serverURL).hostname;
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
const sigstoreBundle = await fetchGithubAttestationBundle(this.configRepo, digest);
|
|
25
|
-
return this.performVerification(attestationDoc, undefined, digest, sigstoreBundle, domain);
|
|
20
|
+
const bundle = await assembleAttestationBundle(domain, this.configRepo);
|
|
21
|
+
return this.verifyBundle(bundle);
|
|
26
22
|
}
|
|
27
23
|
async verifyBundle(bundle) {
|
|
28
|
-
|
|
29
|
-
throw new Error('enclaveCert is required for bundle verification');
|
|
30
|
-
}
|
|
31
|
-
return this.performVerification(bundle.enclaveAttestationReport, bundle.vcek, bundle.digest, bundle.sigstoreBundle, bundle.domain, bundle.enclaveCert);
|
|
32
|
-
}
|
|
33
|
-
async performVerification(attestationDoc, vcek, digest, sigstoreBundle, domain, enclaveCert) {
|
|
24
|
+
const { enclaveAttestationReport: attestationDoc, vcek, digest, sigstoreBundle, domain, enclaveCert } = bundle;
|
|
34
25
|
const steps = {
|
|
35
26
|
fetchDigest: { status: 'success' }, // Already fetched by caller
|
|
36
27
|
verifyCode: { status: 'pending' },
|
|
37
28
|
verifyEnclave: { status: 'pending' },
|
|
38
29
|
compareMeasurements: { status: 'pending' },
|
|
39
|
-
verifyCertificate:
|
|
30
|
+
verifyCertificate: { status: 'pending' },
|
|
40
31
|
};
|
|
41
32
|
try {
|
|
42
33
|
// Step 1: Verify enclave attestation
|
|
@@ -50,10 +41,10 @@ export class Verifier {
|
|
|
50
41
|
this.saveFailedVerificationDocument(steps, domain);
|
|
51
42
|
throw error;
|
|
52
43
|
}
|
|
53
|
-
// Step 2: Verify code
|
|
44
|
+
// Step 2: Verify code provenance (Sigstore bundle)
|
|
54
45
|
let codeMeasurements;
|
|
55
46
|
try {
|
|
56
|
-
codeMeasurements = await
|
|
47
|
+
codeMeasurements = await verifySigstoreBundle(sigstoreBundle, digest, this.configRepo);
|
|
57
48
|
steps.verifyCode = { status: 'success' };
|
|
58
49
|
}
|
|
59
50
|
catch (error) {
|
|
@@ -67,34 +58,19 @@ export class Verifier {
|
|
|
67
58
|
steps.compareMeasurements = { status: 'success' };
|
|
68
59
|
}
|
|
69
60
|
catch (error) {
|
|
70
|
-
|
|
71
|
-
steps.compareMeasurements = { status: 'failed', error: error.message };
|
|
72
|
-
}
|
|
73
|
-
else if (error instanceof MeasurementMismatchError) {
|
|
74
|
-
steps.compareMeasurements = { status: 'failed', error: error.message };
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
steps.compareMeasurements = { status: 'failed', error: error.message };
|
|
78
|
-
}
|
|
61
|
+
steps.compareMeasurements = { status: 'failed', error: error.message };
|
|
79
62
|
this.saveFailedVerificationDocument(steps, domain);
|
|
80
63
|
throw error;
|
|
81
64
|
}
|
|
82
|
-
// Step 4: Verify certificate
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
steps.verifyCertificate = { status: 'failed', error: error.message };
|
|
94
|
-
}
|
|
95
|
-
this.saveFailedVerificationDocument(steps, domain);
|
|
96
|
-
throw error;
|
|
97
|
-
}
|
|
65
|
+
// Step 4: Verify certificate
|
|
66
|
+
try {
|
|
67
|
+
await verifyCertificate(enclaveCert, domain, attestationDoc, amdVerification.hpkePublicKey || '');
|
|
68
|
+
steps.verifyCertificate = { status: 'success' };
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
steps.verifyCertificate = { status: 'failed', error: error.message };
|
|
72
|
+
this.saveFailedVerificationDocument(steps, domain);
|
|
73
|
+
throw error;
|
|
98
74
|
}
|
|
99
75
|
// Build successful verification document
|
|
100
76
|
this.verificationDocument = {
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,IAAI,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAQjD,MAAM,OAAO,QAAQ;IAKnB,YAAY,OAAwB;QAClC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YACxB,MAAM,IAAI,kBAAkB,CAAC,qCAAqC,CAAC,CAAC;QACtE,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,MAAM;QACV,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,MAAM,IAAI,kBAAkB,CAAC,4FAA4F,CAAC,CAAC;QAC7H,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC;QAChD,MAAM,MAAM,GAAG,MAAM,yBAAyB,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACx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
{"version":3,"file":"dcode.d.ts","sourceRoot":"","sources":["../src/dcode.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"dcode.d.ts","sourceRoot":"","sources":["../src/dcode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsBH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAU3E;AAED,eAAO,MAAM,UAAU,GAAI,GAAG,UAAU,WACmB,CAAC"}
|