@learncard/sss-key-manager 0.2.0 → 0.2.2
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 +13 -0
- package/dist/escrow-attestation.d.ts +2 -5
- package/dist/escrow-attestation.d.ts.map +1 -1
- package/dist/escrow-authority.d.ts +112 -0
- package/dist/escrow-authority.d.ts.map +1 -0
- package/dist/escrow-authority.types.d.ts +51 -0
- package/dist/escrow-authority.types.d.ts.map +1 -0
- package/dist/escrow-crypto.d.ts +9 -1
- package/dist/escrow-crypto.d.ts.map +1 -1
- package/dist/escrow-enrollment-intent.d.ts +13 -0
- package/dist/escrow-enrollment-intent.d.ts.map +1 -0
- package/dist/escrow-enrollment-intent.types.d.ts +28 -0
- package/dist/escrow-enrollment-intent.types.d.ts.map +1 -0
- package/dist/escrow-nitro-attestation.d.ts +34 -0
- package/dist/escrow-nitro-attestation.d.ts.map +1 -0
- package/dist/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/sss-key-manager.cjs.development.js +4478 -424
- package/dist/sss-key-manager.cjs.development.js.map +4 -4
- package/dist/sss-key-manager.cjs.production.min.js +37 -32
- package/dist/sss-key-manager.cjs.production.min.js.map +4 -4
- package/dist/sss-key-manager.esm.js +1813 -265
- package/dist/sss-key-manager.esm.js.map +4 -4
- package/dist/sss-strategy.d.ts.map +1 -1
- package/dist/types.d.ts +31 -5
- package/dist/types.d.ts.map +1 -1
- package/package.json +7 -3
- package/src/__fixtures__/escrow-authority-v1.json +96 -0
- package/src/__fixtures__/escrow-carry-contact-contract-v1.json +33 -0
- package/src/__fixtures__/escrow-enrollment-intent-v1.json +26 -0
- package/src/__fixtures__/escrow-vectors-rust.json +82 -0
- package/src/__fixtures__/escrow-vectors.json +103 -0
- package/src/__fixtures__/nitro-attestation/bad-signature.cbor.b64 +1 -0
- package/src/__fixtures__/nitro-attestation/debug-zero-pcrs.cbor.b64 +1 -0
- package/src/__fixtures__/nitro-attestation/legacy-user-data.cbor.b64 +1 -0
- package/src/__fixtures__/nitro-attestation/manifest.json +60 -0
- package/src/__fixtures__/nitro-attestation/nonce-mismatch.cbor.b64 +1 -0
- package/src/__fixtures__/nitro-attestation/root.pem +12 -0
- package/src/__fixtures__/nitro-attestation/stale-timestamp.cbor.b64 +1 -0
- package/src/__fixtures__/nitro-attestation/tampered-previous-key-ids.cbor.b64 +1 -0
- package/src/__fixtures__/nitro-attestation/truncated-chain.cbor.b64 +1 -0
- package/src/__fixtures__/nitro-attestation/valid.cbor.b64 +1 -0
- package/src/__fixtures__/nitro-attestation/wrong-pcr0.cbor.b64 +1 -0
- package/src/__fixtures__/nitro-attestation/wrong-root.cbor.b64 +1 -0
- package/src/__fixtures__/nitro-attestation-real/staging-nsm-document.json +16 -0
- package/src/escrow-attestation.test.ts +7 -2
- package/src/escrow-attestation.ts +72 -10
- package/src/escrow-authority.test.ts +643 -0
- package/src/escrow-authority.ts +597 -0
- package/src/escrow-authority.types.ts +56 -0
- package/src/escrow-crypto.ts +39 -1
- package/src/escrow-enrollment-intent.test.ts +224 -0
- package/src/escrow-enrollment-intent.ts +236 -0
- package/src/escrow-enrollment-intent.types.ts +28 -0
- package/src/escrow-nitro-attestation.test.ts +276 -0
- package/src/escrow-nitro-attestation.ts +317 -0
- package/src/escrow-vectors.test.ts +198 -0
- package/src/index.ts +35 -1
- package/src/sss-authority.test.ts +889 -0
- package/src/sss-session-writes.test.ts +2 -2
- package/src/sss-strategy.test.ts +95 -2
- package/src/sss-strategy.ts +596 -115
- package/src/types.ts +34 -4
package/README.md
CHANGED
|
@@ -63,6 +63,19 @@ protected write.
|
|
|
63
63
|
|
|
64
64
|
## Security Model
|
|
65
65
|
|
|
66
|
+
### Nitro attestation trust policy
|
|
67
|
+
|
|
68
|
+
Nitro enrollment verifies a nonce-bound COSE ES384 document, the certificate chain against a
|
|
69
|
+
pinned root DER SHA-256 (AWS Nitro Root G1 by default), and one complete PCR0/1/2 tuple.
|
|
70
|
+
Configure `pinnedMeasurements: [{ pcr0, pcr1, pcr2, imageSha384? }]` with 48-byte hex PCRs.
|
|
71
|
+
Legacy `{ imageSha384 }` entries remain type-compatible but **never match**; they cannot authorize
|
|
72
|
+
enrollment. `rootCertificateSha256` is an explicit trust-anchor override (test roots must never be
|
|
73
|
+
used in production). `maxAgeMs` defaults to 300000; future timestamps allow at most 60 seconds skew.
|
|
74
|
+
The escrow P-256 SPKI comes only from signed `user_data`, not the NSM `public_key` used for KMS.
|
|
75
|
+
`verifyEnclaveAttestation(attestation, policy, nonce)` requires the expected 32-byte nonce in Nitro
|
|
76
|
+
mode. The strategy sends a fresh hex nonce on each attestation GET; software mode ignores the nonce
|
|
77
|
+
and continues to require a pinned public key.
|
|
78
|
+
|
|
66
79
|
- **Device Share**: Encrypted with non-extractable AES-GCM key stored in IndexedDB
|
|
67
80
|
- **Auth Share**: Server-side envelope encryption (DEK + KMS-encrypted DEK)
|
|
68
81
|
- **Recovery Share**: Password-based uses Argon2id KDF with secure parameters
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { EscrowAttestationPolicy } from './types';
|
|
2
|
+
import type { VerifiedEnclaveIdentity } from './escrow-authority.types';
|
|
2
3
|
/** Parse untrusted attestation data and enforce an explicit enclave trust policy. */
|
|
3
|
-
export declare const verifyEnclaveAttestation: (attestation: unknown, policy: EscrowAttestationPolicy) => Promise<
|
|
4
|
-
publicKey: string;
|
|
5
|
-
keyId: string;
|
|
6
|
-
mode: "software" | "nitro";
|
|
7
|
-
}>;
|
|
4
|
+
export declare const verifyEnclaveAttestation: (attestation: unknown, policy: EscrowAttestationPolicy, nonce?: Uint8Array) => Promise<VerifiedEnclaveIdentity>;
|
|
8
5
|
//# sourceMappingURL=escrow-attestation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escrow-attestation.d.ts","sourceRoot":"","sources":["../src/escrow-attestation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"escrow-attestation.d.ts","sourceRoot":"","sources":["../src/escrow-attestation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAkBxE,qFAAqF;AACrF,eAAO,MAAM,wBAAwB,GACjC,aAAa,OAAO,EACpB,QAAQ,uBAAuB,EAC/B,QAAQ,UAAU,KACnB,OAAO,CAAC,uBAAuB,CAoGjC,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { HistoricalEscrowEvidence } from './escrow-authority.types';
|
|
2
|
+
import type { EscrowAttestationPolicy } from './types';
|
|
3
|
+
import type { EscrowBlobPlaintext, EscrowEnvelope } from './escrow-crypto';
|
|
4
|
+
import type { EscrowEnrollmentIntent, SignedEscrowEnrollmentIntent } from './escrow-enrollment-intent.types';
|
|
5
|
+
import type { EscrowAuthorityRecord, EscrowAuthorityState, VerifiedEnclaveIdentity, VerifiedEscrowMutation } from './escrow-authority.types';
|
|
6
|
+
/** Derive historical receipt pins from the same complete PCR tuples used for
|
|
7
|
+
* Nitro attestation. Legacy image-only pins and malformed tuples authorize nothing. */
|
|
8
|
+
export declare const escrowAuthorityMeasurements: (policy: EscrowAttestationPolicy) => Promise<string[]>;
|
|
9
|
+
/** Check challenge, scope and signed state; never trust the unsigned duplicate. */
|
|
10
|
+
export declare const verifyEscrowAuthorityState: (response: unknown, nonce: string, tenant: string, did: string, identity: VerifiedEnclaveIdentity) => Promise<EscrowAuthorityState>;
|
|
11
|
+
/** Accept only the committed output of this exact owner intent, including reseals. */
|
|
12
|
+
export declare const verifyEscrowEnrollmentCommit: (response: unknown, intent: EscrowEnrollmentIntent, identity: VerifiedEnclaveIdentity) => Promise<VerifiedEscrowMutation>;
|
|
13
|
+
/** Opaque wire shape of `SignedHoldRecord` (wire.rs `HoldRecord` / policy.rs
|
|
14
|
+
* `SignedHoldRecord`) — exactly the fields `hold_hash` commits to, plus the
|
|
15
|
+
* embedded enclave signature over the hold's own creation. */
|
|
16
|
+
export interface EscrowHoldRecordLike {
|
|
17
|
+
hold: {
|
|
18
|
+
holdId: string;
|
|
19
|
+
did: string;
|
|
20
|
+
shareVersion: number;
|
|
21
|
+
blobHash: string;
|
|
22
|
+
enrollmentEpoch: number;
|
|
23
|
+
releasePolicy: 'hold' | 'pin';
|
|
24
|
+
clientEphemeralPublicKey: string;
|
|
25
|
+
createdLo: number;
|
|
26
|
+
createdHi: number;
|
|
27
|
+
policyVersion: number;
|
|
28
|
+
signature: string;
|
|
29
|
+
};
|
|
30
|
+
holdDurationMs: number;
|
|
31
|
+
ledgerSeq: number;
|
|
32
|
+
}
|
|
33
|
+
export interface VerifiedEscrowHold {
|
|
34
|
+
receipt: EscrowAuthorityRecord;
|
|
35
|
+
authorityGeneration: string;
|
|
36
|
+
holdDigest: string;
|
|
37
|
+
}
|
|
38
|
+
/** Verify the enclave committed to creating THIS exact hold before trusting
|
|
39
|
+
* a `SignedHoldRecord` returned by lca-api: recipient key, DID, blob
|
|
40
|
+
* identity and hold id all come from the caller's own expectations (never
|
|
41
|
+
* from the record alone), and the embedded signature is checked against the
|
|
42
|
+
* attested ledger key exactly like `verifyEscrowEnrollmentCommit`. Returns
|
|
43
|
+
* the record's own `authorityGeneration` so a later confirmation/warning
|
|
44
|
+
* receipt for the SAME hold can be pinned to it.
|
|
45
|
+
* `historical` explicitly permits an older signed measurement only if it is
|
|
46
|
+
* allowlisted, verifies with the current attested ledger key and an attested
|
|
47
|
+
* current/previous key ID, and matches the retained authority generation.
|
|
48
|
+
* Never use historical verification for newly produced confirmation evidence. */
|
|
49
|
+
export declare const verifyEscrowHoldRecord: (record: EscrowHoldRecordLike, expected: {
|
|
50
|
+
tenant: string;
|
|
51
|
+
did: string;
|
|
52
|
+
clientEphemeralPublicKey: string;
|
|
53
|
+
blobHash: string;
|
|
54
|
+
holdId: string;
|
|
55
|
+
}, identity: VerifiedEnclaveIdentity, historical?: HistoricalEscrowEvidence) => Promise<VerifiedEscrowHold>;
|
|
56
|
+
/** Verify a confirm-hold / send-release-warning result commits to THIS exact
|
|
57
|
+
* hold (the one `verifyEscrowHoldRecord` already verified). A fresh
|
|
58
|
+
* `commit`'s `requestDigest` is a secret-keyed, PIN-style hash the client
|
|
59
|
+
* cannot recompute by design (publishing an unkeyed digest here would be an
|
|
60
|
+
* offline oracle — see escrow-enclave-app's ledger "Operation commitments"),
|
|
61
|
+
* so a fresh commit is checked on tenant/generation/DID binding, epoch and
|
|
62
|
+
* blob identity only. The idempotent retry **snapshot** instead embeds
|
|
63
|
+
* `signedHoldDigest` directly in its (unkeyed) payload, so a snapshot
|
|
64
|
+
* additionally recomputes and compares the hold digest — exactly binding a
|
|
65
|
+
* retry to the hold the client itself started, not a different one. A caller
|
|
66
|
+
* receiving a commit MUST also obtain and verify this snapshot before claiming
|
|
67
|
+
* hold-specific confirmation (as createSSSStrategy does). */
|
|
68
|
+
export declare const verifyEscrowHoldConfirmation: (receipt: unknown, record: EscrowHoldRecordLike, expected: {
|
|
69
|
+
tenant: string;
|
|
70
|
+
did: string;
|
|
71
|
+
authorityGeneration: string;
|
|
72
|
+
}, identity: VerifiedEnclaveIdentity) => Promise<EscrowAuthorityRecord>;
|
|
73
|
+
export type EscrowEnrollmentActionInput = 'automatic' | 'set' | 'clear' | 'disable';
|
|
74
|
+
/** Pure action resolution, shared between intent-building (here) and blob
|
|
75
|
+
* plaintext construction (sss-strategy.ts's `enrollEscrow`), so both always
|
|
76
|
+
* agree on enroll/replace/carry/disable from the same inputs instead of
|
|
77
|
+
* maintaining two copies of this decision. P9.1 (attack C) / P2-d:
|
|
78
|
+
* `bindsRecoveryContact` is the single source of truth for whether
|
|
79
|
+
* `recoveryEmail`/`recoveryLanguage` may appear in EITHER the signed intent
|
|
80
|
+
* or the target blob plaintext — Rust rejects a Carry target blob whose
|
|
81
|
+
* plaintext already carries either field (the enclave fills them in from
|
|
82
|
+
* the source blob instead), so this must be computed identically in both
|
|
83
|
+
* places or a carry can be built with a blob the enclave will refuse. */
|
|
84
|
+
export declare const resolveEscrowEnrollmentAction: (current: Pick<EscrowAuthorityState, "status" | "hasPin">, input: EscrowEnrollmentActionInput) => {
|
|
85
|
+
action: EscrowEnrollmentIntent["action"];
|
|
86
|
+
pinAction: EscrowEnrollmentIntent["pinAction"];
|
|
87
|
+
bindsRecoveryContact: boolean;
|
|
88
|
+
};
|
|
89
|
+
/** P2-d cross-language contract: mirrors the enclave's Carry contact-field
|
|
90
|
+
* rejection rule (`apply_enrollment_intent` in authority.rs) — true means
|
|
91
|
+
* the enclave would refuse this target blob. The enclave always fills
|
|
92
|
+
* recoveryEmail/recoveryLanguage in from the source blob on carry, so a
|
|
93
|
+
* target that already claims either field is refused. Shared by
|
|
94
|
+
* `escrow-carry-contact-contract-v1.json`'s TS and Rust tests, and by any
|
|
95
|
+
* caller (e.g. a test fake) that wants to fail the same way the real
|
|
96
|
+
* enclave does instead of accepting a shape it would reject. */
|
|
97
|
+
export declare const violatesCarryContactRule: (action: EscrowEnrollmentIntent["action"], target: Pick<EscrowBlobPlaintext, "recoveryEmail" | "recoveryLanguage"> | null) => boolean;
|
|
98
|
+
/** Owner-only mutation selection. Recovery itself never calls this helper.
|
|
99
|
+
* P9.1 (attack C): `recoveryEmail`/`recoveryLanguage` are always supplied by the
|
|
100
|
+
* caller (the device's authenticated account email + app locale) but are only
|
|
101
|
+
* bound into the intent for enroll/replace; disable/carry null them out here
|
|
102
|
+
* regardless of input, since the enclave carries the prior value forward. */
|
|
103
|
+
export declare const createEscrowEnrollmentIntent: (input: {
|
|
104
|
+
state: EscrowAuthorityState;
|
|
105
|
+
target: EscrowEnvelope | null;
|
|
106
|
+
shareVersion: number;
|
|
107
|
+
privateKey: string;
|
|
108
|
+
pinAction: EscrowEnrollmentActionInput;
|
|
109
|
+
recoveryEmail: string;
|
|
110
|
+
recoveryLanguage: string;
|
|
111
|
+
}) => Promise<SignedEscrowEnrollmentIntent>;
|
|
112
|
+
//# sourceMappingURL=escrow-authority.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escrow-authority.d.ts","sourceRoot":"","sources":["../src/escrow-authority.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAMvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,KAAK,EACR,sBAAsB,EACtB,4BAA4B,EAC/B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EACR,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACzB,MAAM,0BAA0B,CAAC;AAwElC;uFACuF;AACvF,eAAO,MAAM,2BAA2B,GACpC,QAAQ,uBAAuB,KAChC,OAAO,CAAC,MAAM,EAAE,CAclB,CAAC;AA2IF,mFAAmF;AACnF,eAAO,MAAM,0BAA0B,GACnC,UAAU,OAAO,EACjB,OAAO,MAAM,EACb,QAAQ,MAAM,EACd,KAAK,MAAM,EACX,UAAU,uBAAuB,KAClC,OAAO,CAAC,oBAAoB,CAgB9B,CAAC;AAEF,sFAAsF;AACtF,eAAO,MAAM,4BAA4B,GACrC,UAAU,OAAO,EACjB,QAAQ,sBAAsB,EAC9B,UAAU,uBAAuB,KAClC,OAAO,CAAC,sBAAsB,CA0ChC,CAAC;AAEF;;8DAE8D;AAC9D,MAAM,WAAW,oBAAoB;IACjC,IAAI,EAAE;QACF,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;QACZ,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,MAAM,CAAC;QACjB,eAAe,EAAE,MAAM,CAAC;QACxB,aAAa,EAAE,MAAM,GAAG,KAAK,CAA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ACzC,SAAS,EAAE,sBAAsB,CAAC,WAAW,CAAC,CAAC;IAC/C,oBAAoB,EAAE,OAAO,CAAC;CAsBjC,CAAC;AAEF;;;;;;;gEAOgE;AAChE,eAAO,MAAM,wBAAwB,GACjC,QAAQ,sBAAsB,CAAC,QAAQ,CAAC,EACxC,QAAQ,IAAI,CAAC,mBAAmB,EAAE,eAAe,GAAG,kBAAkB,CAAC,GAAG,IAAI,KAC/E,OACwF,CAAC;AAE5F;;;;6EAI6E;AAC7E,eAAO,MAAM,4BAA4B,GAAU,OAAO;IACtD,KAAK,EAAE,oBAAoB,CAAC;IAC5B,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,2BAA2B,CAAC;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;CAC5B,KAAG,OAAO,CAAC,4BAA4B,CAoCvC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { EscrowEnvelope } from './escrow-crypto';
|
|
2
|
+
/** Unverifiable or substituted recovery evidence; callers must not continue recovery. */
|
|
3
|
+
export declare class EscrowEvidenceError extends Error {
|
|
4
|
+
constructor();
|
|
5
|
+
}
|
|
6
|
+
/** Opt-in for previously issued hold evidence only. Measurements are SHA-256
|
|
7
|
+
* hashes of complete configured PCR0/1/2 tuples, never server-supplied values.
|
|
8
|
+
* The original authority generation and current attested ledger key remain pinned.
|
|
9
|
+
* Fresh receipts must omit this option and match the current measurement exactly. */
|
|
10
|
+
export interface HistoricalEscrowEvidence {
|
|
11
|
+
historical: true;
|
|
12
|
+
allowedMeasurements: readonly string[];
|
|
13
|
+
authorityGeneration: string;
|
|
14
|
+
}
|
|
15
|
+
/** Only construct from verified, nonce-bound NSM evidence (never wrapper JSON). */
|
|
16
|
+
export interface VerifiedEnclaveIdentity {
|
|
17
|
+
publicKey: string;
|
|
18
|
+
keyId: string;
|
|
19
|
+
previousKeyIds: string[];
|
|
20
|
+
mode: 'software' | 'nitro';
|
|
21
|
+
authority?: {
|
|
22
|
+
ledgerPublicKey: string;
|
|
23
|
+
measurement: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface EscrowAuthorityRecord {
|
|
27
|
+
version: 1;
|
|
28
|
+
kind: 'proposal' | 'commit' | 'snapshot';
|
|
29
|
+
keyId: string;
|
|
30
|
+
measurement: number[];
|
|
31
|
+
payload: string;
|
|
32
|
+
signature: string;
|
|
33
|
+
}
|
|
34
|
+
export interface EscrowAuthorityState {
|
|
35
|
+
tenant: string;
|
|
36
|
+
authorityGeneration: string;
|
|
37
|
+
did: string;
|
|
38
|
+
enrollmentVersion: number;
|
|
39
|
+
enrollmentEpoch: number;
|
|
40
|
+
status: 'empty' | 'active' | 'disabled';
|
|
41
|
+
envelope: EscrowEnvelope | null;
|
|
42
|
+
shareVersion: number | null;
|
|
43
|
+
hasPin: boolean;
|
|
44
|
+
pinGeneration: number;
|
|
45
|
+
attemptsUsed: number;
|
|
46
|
+
}
|
|
47
|
+
export interface VerifiedEscrowMutation {
|
|
48
|
+
envelope: EscrowEnvelope | null;
|
|
49
|
+
receipt: EscrowAuthorityRecord;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=escrow-authority.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escrow-authority.types.d.ts","sourceRoot":"","sources":["../src/escrow-authority.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,yFAAyF;AACzF,qBAAa,mBAAoB,SAAQ,KAAK;;CAK7C;AAED;;;qFAGqF;AACrF,MAAM,WAAW,wBAAwB;IACrC,UAAU,EAAE,IAAI,CAAC;IACjB,mBAAmB,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,mBAAmB,EAAE,MAAM,CAAC;CAC/B;AAED,mFAAmF;AACnF,MAAM,WAAW,uBAAuB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC;IAC3B,SAAS,CAAC,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;CAChE;AAED,MAAM,WAAW,qBAAqB;IAClC,OAAO,EAAE,CAAC,CAAC;IACX,IAAI,EAAE,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,EAAE,MAAM,CAAC;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,iBAAiB,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;IACxC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACnC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAChC,OAAO,EAAE,qBAAqB,CAAC;CAClC"}
|
package/dist/escrow-crypto.d.ts
CHANGED
|
@@ -18,13 +18,21 @@ export interface EscrowEnvelope {
|
|
|
18
18
|
iv: string;
|
|
19
19
|
ciphertext: string;
|
|
20
20
|
}
|
|
21
|
-
/**
|
|
21
|
+
/** P9.1 (attack C): the app's compiled template languages. Keep in lockstep with
|
|
22
|
+
* apps/learn-card-app/src/i18n's SUPPORTED_LANGUAGES and the Rust RECOVERY_LANGUAGES. */
|
|
23
|
+
export declare const RECOVERY_LANGUAGES: readonly ["en", "es", "fr", "ar"];
|
|
24
|
+
/** Recovery share bound to an identity and a positive share version.
|
|
25
|
+
* `recoveryEmail`/`recoveryLanguage`: bound by the user's own device at
|
|
26
|
+
* enrollment, never by lca-api. Always both-present or both-absent; changing
|
|
27
|
+
* the address requires a fresh `replace` enrollment, not an edit. */
|
|
22
28
|
export interface EscrowBlobPlaintext {
|
|
23
29
|
version: typeof ESCROW_ENVELOPE_VERSION;
|
|
24
30
|
recoveryShare: string;
|
|
25
31
|
did: string;
|
|
26
32
|
shareVersion: number;
|
|
27
33
|
pinVerifier?: string;
|
|
34
|
+
recoveryEmail?: string;
|
|
35
|
+
recoveryLanguage?: string;
|
|
28
36
|
}
|
|
29
37
|
/** Released recovery share additionally bound to its recovery hold. */
|
|
30
38
|
export interface EscrowReleasePlaintext extends EscrowBlobPlaintext {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escrow-crypto.d.ts","sourceRoot":"","sources":["../src/escrow-crypto.ts"],"names":[],"mappings":"AAQA,4CAA4C;AAC5C,eAAO,MAAM,uBAAuB,EAAG,CAAU,CAAC;AAClD,oDAAoD;AACpD,eAAO,MAAM,gBAAgB,EAAG,+BAAwC,CAAC;AACzE,oDAAoD;AACpD,eAAO,MAAM,gBAAgB,6BAA6B,CAAC;AAC3D,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,gCAAgC,CAAC;AACjE,4DAA4D;AAC5D,eAAO,MAAM,oBAAoB,EAAG,QAAiB,CAAC;AAEtD,kFAAkF;AAClF,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,OAAO,uBAAuB,CAAC;IACxC,SAAS,EAAE,OAAO,gBAAgB,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,EAAE,MAAM,CAAC;IAC3B,IAA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AAO,OAAO,KAAG,cAkBpD,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,wBAAwB,GAAI,OAAO,OAAO,KAAG,mBA4DzD,CAAC;AAEF,kFAAkF;AAClF,eAAO,MAAM,2BAA2B,GAAI,OAAO,OAAO,KAAG,sBAQ5D,CAAC;AA0BF,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,QAAa,OAAO,CAAC;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACtB,CAUA,CAAC;AA8FF,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,GAC1B,OAAO,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC,EAC3C,yBAAyB,MAAM,EAC/B,OAAO,MAAM,KACd,OAAO,CAAC,cAAc,CASxB,CAAC;AAEF,0EAA0E;AAC1E,eAAO,MAAM,iBAAiB,GAC1B,UAAU,OAAO,EACjB,2BAA2B,MAAM,KAClC,OAAO,CAAC,mBAAmB,CAGzB,CAAC;AAEN,wFAAwF;AACxF,eAAO,MAAM,iBAAiB,GAC1B,OAAO,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAC,EAC9C,iCAAiC,MAAM,KACxC,OAAO,CAAC,cAAc,CASxB,CAAC;AAEF,8FAA8F;AAC9F,eAAO,MAAM,iBAAiB,GAC1B,UAAU,OAAO,EACjB,mCAAmC,MAAM,KAC1C,OAAO,CAAC,sBAAsB,CAG5B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EscrowEnvelope } from './escrow-crypto';
|
|
2
|
+
import type { EscrowEnrollmentIntent, SignedEscrowEnrollmentIntent } from './escrow-enrollment-intent.types';
|
|
3
|
+
export declare const ESCROW_ENROLLMENT_INTENT_DOMAIN = "learncard-escrow-enrollment-intent-v2\0";
|
|
4
|
+
/** Produce the exact Rust-verified V1 message, never JSON or a prehashed signature. */
|
|
5
|
+
export declare const encodeEscrowEnrollmentIntent: (intent: EscrowEnrollmentIntent) => Uint8Array<ArrayBuffer>;
|
|
6
|
+
/** Sign with the account's 32-byte Ed25519 seed. Never needed for recovery itself.
|
|
7
|
+
* The caller must obtain generation/current version from an attested authority
|
|
8
|
+
* response and construct the exact operation it intends; signing is not consent UI.
|
|
9
|
+
*/
|
|
10
|
+
export declare const signEscrowEnrollmentIntent: (intent: EscrowEnrollmentIntent, privateKey: string) => Promise<SignedEscrowEnrollmentIntent>;
|
|
11
|
+
/** Canonical blob identity matches Rust, including Q/-Q ECDH equivalence. */
|
|
12
|
+
export declare const getEscrowBlobIdentity: (input: EscrowEnvelope) => Promise<string>;
|
|
13
|
+
//# sourceMappingURL=escrow-enrollment-intent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escrow-enrollment-intent.d.ts","sourceRoot":"","sources":["../src/escrow-enrollment-intent.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EACR,sBAAsB,EACtB,4BAA4B,EAC/B,MAAM,kCAAkC,CAAC;AAI1C,eAAO,MAAM,+BAA+B,4CAA4C,CAAC;AAkFzF,uFAAuF;AACvF,eAAO,MAAM,4BAA4B,GACrC,QAAQ,sBAAsB,KAC/B,UAAU,CAAC,WAAW,CA8ExB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,GACnC,QAAQ,sBAAsB,EAC9B,YAAY,MAAM,KACnB,OAAO,CAAC,4BAA4B,CAgBtC,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,qBAAqB,GAAU,OAAO,cAAc,KAAG,OAAO,CAAC,MAAM,CAiCjF,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** V2 owner authorization, distinct from authentication and from recovery. */
|
|
2
|
+
export interface EscrowEnrollmentIntent {
|
|
3
|
+
version: 2;
|
|
4
|
+
tenant: string;
|
|
5
|
+
did: string;
|
|
6
|
+
authorityGeneration: string;
|
|
7
|
+
expectedEnrollmentVersion: number;
|
|
8
|
+
action: 'enroll' | 'replace' | 'disable' | 'carry';
|
|
9
|
+
sourceBlobIdentity: string | null;
|
|
10
|
+
targetBlobIdentity: string | null;
|
|
11
|
+
pinAction: 'set' | 'change' | 'clear' | 'keep';
|
|
12
|
+
shareVersion: number;
|
|
13
|
+
enrollmentEpoch: number;
|
|
14
|
+
requestId: string;
|
|
15
|
+
allowRewrap: boolean;
|
|
16
|
+
/** P9.1 (attack C): required (and must match the blob) on enroll/replace;
|
|
17
|
+
* must be null on disable/carry (the enclave carries the prior value forward).
|
|
18
|
+
* Changing the address requires a fresh signed `replace` intent, not an edit. */
|
|
19
|
+
recoveryEmail: string | null;
|
|
20
|
+
/** One of the app's compiled template languages (currently en/es/fr/ar). */
|
|
21
|
+
recoveryLanguage: string | null;
|
|
22
|
+
}
|
|
23
|
+
/** Signature is canonical padded standard base64 of raw Ed25519 R || S. */
|
|
24
|
+
export interface SignedEscrowEnrollmentIntent {
|
|
25
|
+
intent: EscrowEnrollmentIntent;
|
|
26
|
+
signature: string;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=escrow-enrollment-intent.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escrow-enrollment-intent.types.d.ts","sourceRoot":"","sources":["../src/escrow-enrollment-intent.types.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,MAAM,WAAW,sBAAsB;IACnC,OAAO,EAAE,CAAC,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,mBAAmB,EAAE,MAAM,CAAC;IAC5B,yBAAyB,EAAE,MAAM,CAAC;IAClC,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACnD,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IAC/C,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB;;sFAEkF;IAClF,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,4EAA4E;IAC5E,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,2EAA2E;AAC3E,MAAM,WAAW,4BAA4B;IACzC,MAAM,EAAE,sBAAsB,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import type { EscrowAttestationPolicy } from './types';
|
|
3
|
+
export type NitroAttestationReason = 'cbor' | 'cose' | 'alg' | 'chain' | 'root' | 'signature' | 'pcr' | 'debug' | 'nonce' | 'freshness' | 'user-data';
|
|
4
|
+
/** A fail-closed attestation failure with a stable, non-sensitive reason. */
|
|
5
|
+
export declare class NitroAttestationError extends Error {
|
|
6
|
+
readonly reason: NitroAttestationReason;
|
|
7
|
+
constructor(reason: NitroAttestationReason);
|
|
8
|
+
}
|
|
9
|
+
type NitroPolicy = Extract<EscrowAttestationPolicy, {
|
|
10
|
+
mode: 'nitro';
|
|
11
|
+
}>;
|
|
12
|
+
/** Verify signed NSM evidence before trusting its P-256 escrow key (not public_key/KMS key). */
|
|
13
|
+
export declare const verifyNitroAttestationDocument: (documentB64: string, { expectedNonce, policy, now, }: {
|
|
14
|
+
expectedNonce: Uint8Array;
|
|
15
|
+
policy: NitroPolicy;
|
|
16
|
+
now?: number;
|
|
17
|
+
}) => Promise<{
|
|
18
|
+
escrowPublicKeySpkiB64: string;
|
|
19
|
+
/** P9.1: the enclave's own current keyId, bound inside this same signed
|
|
20
|
+
* document. `undefined` for the legacy user_data format, which never
|
|
21
|
+
* carried a keyId — callers must not silently trust a plaintext keyId in
|
|
22
|
+
* that case any more than they did before this field existed. */
|
|
23
|
+
keyId: string | undefined;
|
|
24
|
+
/** P9.1: retired keyIds the enclave still accepts for decrypt only, bound
|
|
25
|
+
* inside this same signed document. Empty for the legacy user_data format. */
|
|
26
|
+
previousKeyIds: string[];
|
|
27
|
+
pcrs: Record<number, string>;
|
|
28
|
+
timestamp: number;
|
|
29
|
+
moduleId: string;
|
|
30
|
+
ledgerPublicKey?: string;
|
|
31
|
+
measurementHash?: string;
|
|
32
|
+
}>;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=escrow-nitro-attestation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"escrow-nitro-attestation.d.ts","sourceRoot":"","sources":["../src/escrow-nitro-attestation.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAS1B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,MAAM,MAAM,sBAAsB,GAC5B,MAAM,GACN,MAAM,GACN,KAAK,GACL,OAAO,GACP,MAAM,GACN,WAAW,GACX,KAAK,GACL,OAAO,GACP,OAAO,GACP,WAAW,GACX,WAAW,CAAC;AAElB,6EAA6E;AAC7E,qBAAa,qBAAsB,SAAQ,KAAK;aAChB,MAAM,EAAE,sBAAsB;gBAA9B,MAAM,EAAE,sBAAsB;CAI7D;AAGD,KAAK,WAAW,GAAG,OAAO,CAAC,uBAAuB,EAAE;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAiFvE,gGAAgG;AAChG,eAAO,MAAM,8BAA8B,GACvC,aAAa,MAAM,EACnB,iCAIG;IACC,aAAa,EAAE,UAAU,CAAC;IAC1B,MAAM,EAAE,WAAW,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB,KACF,OAAO,CAAC;IACP,sBAAsB,EAAE,MAAM,CAAC;IAC/B;;;qEAGiE;IACjE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;kFAC8E;IAC9E,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B,CA+KA,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,9 +13,19 @@ export { EMAIL_RELAY_ALGORITHM, EMAIL_RELAY_ENVELOPE_VERSION, encryptEmailRelayP
|
|
|
13
13
|
export type { EmailRelayBranding, EmailRelayEnvelope, EmailRelayPlaintext, } from './email-relay-crypto';
|
|
14
14
|
export { ESCROW_ENVELOPE_VERSION, ESCROW_ALGORITHM, ESCROW_BLOB_INFO, ESCROW_RELEASE_INFO, ESCROW_CLIENT_KEY_ID, parseEscrowEnvelope, parseEscrowBlobPlaintext, parseEscrowReleasePlaintext, generateEscrowKeyPair, encryptEscrowBlob, decryptEscrowBlob, sealEscrowRelease, openEscrowRelease, } from './escrow-crypto';
|
|
15
15
|
export type { EscrowEnvelope, EscrowBlobPlaintext, EscrowReleasePlaintext } from './escrow-crypto';
|
|
16
|
+
export { encodeEscrowEnrollmentIntent, signEscrowEnrollmentIntent, getEscrowBlobIdentity, ESCROW_ENROLLMENT_INTENT_DOMAIN, } from './escrow-enrollment-intent';
|
|
17
|
+
export type { EscrowEnrollmentIntent, SignedEscrowEnrollmentIntent, } from './escrow-enrollment-intent.types';
|
|
16
18
|
export { verifyEnclaveAttestation } from './escrow-attestation';
|
|
19
|
+
export { EscrowEvidenceError } from './escrow-authority.types';
|
|
20
|
+
export type { HistoricalEscrowEvidence } from './escrow-authority.types';
|
|
21
|
+
export type { EscrowRecoveryExpectations } from '@learncard/types';
|
|
22
|
+
export { verifyEscrowAuthorityState, verifyEscrowEnrollmentCommit, createEscrowEnrollmentIntent, resolveEscrowEnrollmentAction, violatesCarryContactRule, } from './escrow-authority';
|
|
23
|
+
export type { EscrowEnrollmentActionInput } from './escrow-authority';
|
|
24
|
+
export type { VerifiedEnclaveIdentity, EscrowAuthorityRecord, EscrowAuthorityState, VerifiedEscrowMutation, } from './escrow-authority.types';
|
|
25
|
+
export { verifyNitroAttestationDocument, NitroAttestationError } from './escrow-nitro-attestation';
|
|
26
|
+
export type { NitroAttestationReason } from './escrow-nitro-attestation';
|
|
17
27
|
export type { EscrowAttestationPolicy, EscrowHoldStatus, EscrowRecoveryStart } from './types';
|
|
18
|
-
export type { EscrowEnrollmentOptions, EscrowEnrollmentState, EscrowPinStatus } from './types';
|
|
28
|
+
export type { EscrowEnrollmentOptions, EscrowEnrollmentState, EscrowBlobStaleReason, EscrowPinStatus, } from './types';
|
|
19
29
|
export { EscrowPinMismatchError, EscrowPinLockedError, EscrowPinThrottledError, EscrowHoldRestartThrottledError, EscrowPinUnavailableError, } from './types';
|
|
20
30
|
export { PIN_MIN_LENGTH, PIN_MAX_LENGTH, ESCROW_PIN_MAX_ATTEMPTS, normalizePin, validatePin, generatePinSalt, derivePinProof, constantTimeEqualHex, } from './escrow-pin';
|
|
21
31
|
export { createPasskeyCredential, deriveKeyFromPasskey, encryptShareWithPasskey, decryptShareWithPasskey, isWebAuthnSupported, isPRFSupported, } from './passkey';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EACH,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,GAChB,MAAM,OAAO,CAAC;AAEf,OAAO,EACH,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,iBAA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