@agledger/verify-core 1.3.0 → 1.4.1

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.
@@ -35,6 +35,31 @@ export interface KeyAlgorithm {
35
35
  /** Signature encoding for ECDSA (COSE requires raw r||s, not DER). */
36
36
  dsaEncoding: 'ieee-p1363' | null;
37
37
  }
38
+ /**
39
+ * Look up a table entry by its registry name (`Ed25519`, `ES256`, ...).
40
+ *
41
+ * Exists for the one question `resolveKeyAlgorithm` cannot answer: on a host
42
+ * that refuses to LOAD a key of some algorithm, there is no key object to
43
+ * resolve, yet that is exactly when a caller most needs to ask whether the
44
+ * algorithm is computable here. Pair with `runtimeCanCompute`.
45
+ */
46
+ export declare function algorithmByName(name: string): KeyAlgorithm | null;
47
+ /**
48
+ * Whether these bytes DECLARE themselves an Ed25519 public key, judged without
49
+ * asking node:crypto to load them.
50
+ *
51
+ * Needed because a host that refuses EdDSA refuses at KEY LOAD, not only at
52
+ * verify: with the OpenSSL FIPS provider active, `createPublicKey` throws
53
+ * "Failed to read asymmetric key" and there is no key object left to resolve an
54
+ * algorithm from. Reading the OID separates "this is an Ed25519 key my runtime
55
+ * will not touch" from "these are garbage bytes", which is the difference
56
+ * between an environment problem and tamper. Structure only: it says nothing
57
+ * about whether the key is valid, trusted, or the right one.
58
+ *
59
+ * Byte-identical to the Python verifier's `looks_like_ed25519_key`, so the two
60
+ * implementations classify the same bytes the same way.
61
+ */
62
+ export declare function looksLikeEd25519Key(spkiDer: Uint8Array): boolean;
38
63
  /**
39
64
  * Resolve the algorithm a base64 SPKI DER public key commits to. Returns:
40
65
  *
@@ -53,10 +78,32 @@ export declare function resolveKeyAlgorithm(publicKeyBase64: string): KeyAlgorit
53
78
  *
54
79
  * Refuses non-Ed25519 keys. Node's `verify(null, ...)` silently falls back to
55
80
  * ECDSA/SHA-256 for EC keys, which would accept a signature no conformant
56
- * EdDSA verifier accepts (the engine guards the signing side the same way,
57
- * api#1089), so the key type is asserted before any crypto runs.
81
+ * EdDSA verifier accepts (the engine guards the signing side the same way),
82
+ * so the key type is asserted before any crypto runs.
83
+ *
84
+ * CAUTION for direct callers: as with `verifySignatureBytes`, `false` conflates
85
+ * "did not verify" with "this host cannot compute EdDSA". Check
86
+ * `runtimeCanCompute` first if that distinction matters to you.
58
87
  */
59
88
  export declare function verifyEd25519Bytes(publicKeyBase64: string, input: Uint8Array, signature: Uint8Array): boolean;
89
+ /**
90
+ * Whether the host runtime can actually compute `keyAlg`, proven by running
91
+ * this build's own dispatch against a known-good signature.
92
+ *
93
+ * A throw and a `false` are treated identically: either way the runtime just
94
+ * failed to confirm a signature known to be valid, so it cannot be trusted to
95
+ * tell a good signature from a forged one. Fail closed, and callers must
96
+ * surface this as "NOT verified, verify elsewhere", never as a pass and never
97
+ * as tamper evidence.
98
+ */
99
+ export declare function runtimeCanCompute(keyAlg: KeyAlgorithm): boolean;
100
+ /**
101
+ * Human-readable reason an algorithm could not be computed, for the detail
102
+ * line of CHAIN_UNSUPPORTED_ALGORITHM. Distinguishes the two causes that share
103
+ * that failure code, because they have different remedies: upgrade the
104
+ * verifier, versus re-run somewhere the algorithm is permitted.
105
+ */
106
+ export declare function describeUnsupportedAlgorithm(publicKeyBase64: string): string;
60
107
  /**
61
108
  * Verify a raw signature under whatever algorithm the TRUSTED key commits to.
62
109
  * Generalizes `verifyEd25519Bytes`: the algorithm is resolved from the SPKI
@@ -70,11 +117,17 @@ export declare function verifyEd25519Bytes(publicKeyBase64: string, input: Uint8
70
117
  * engine normalizes to low-S at sign time but, like the engine's verifier,
71
118
  * high-S is accepted here: ECDSA malleability changes the envelope bytes,
72
119
  * which the hash-link layer already pins.
120
+ *
121
+ * CAUTION for direct callers: `false` here means "did not verify" OR "this
122
+ * host cannot compute the algorithm", which are opposite conclusions.
123
+ * `verifyCoseSign1` gates on `runtimeCanCompute` before ever reaching this,
124
+ * so it never conflates them; anything calling this primitive directly must
125
+ * do the same check itself or risk reporting an intact signature as forged.
73
126
  */
74
127
  export declare function verifySignatureBytes(publicKeyBase64: string, input: Uint8Array, signature: Uint8Array): boolean;
75
128
  /**
76
129
  * Decode a tagged COSE_Sign1 envelope into its three load-bearing parts.
77
- * Returns null on any structural failure — the caller surfaces it as
130
+ * Returns null on any structural failure; the caller surfaces it as
78
131
  * CHAIN_COSE_DECODE_FAILED.
79
132
  */
80
133
  export interface CoseSign1Parts {
@@ -123,14 +176,14 @@ export declare function verifyCoseSign1(coseSign1: Uint8Array, publicKeyBase64:
123
176
  * hex, matching the engine's `vault_signing_keys.key_id` shape. Returns null
124
177
  * when absent or malformed. The caller cross-checks it against the row's
125
178
  * `signingKeyId` column: the column is a denormalized convenience, the kid is
126
- * signed, so a rewritten column surfaces as drift (engine mirror: #893).
179
+ * signed, so a rewritten column surfaces as drift (engine mirror: signing_key_drift).
127
180
  */
128
181
  export declare function extractKid(protectedBstr: Uint8Array): string | null;
129
182
  /**
130
183
  * Extract the chain-mechanics private claim (`-65537`) from a COSE_Sign1
131
184
  * protected header. Returns the decoded `{ position, previous_hash }` or null
132
185
  * if the claim is missing/malformed. The caller cross-checks it against the
133
- * row's `chainPosition` / `previousHash` columns — a divergence means the row
186
+ * row's `chainPosition` / `previousHash` columns; a divergence means the row
134
187
  * was renumbered after signing.
135
188
  */
136
189
  export interface ChainClaim {
@@ -154,7 +207,7 @@ export declare function extractTraceparentClaim(payloadBstr: Uint8Array): string
154
207
  /**
155
208
  * Decode the predicate object from a COSE_Sign1 payload bstr. The payload IS
156
209
  * the in-toto v1 Statement; the predicate body lives at `payload.predicate`.
157
- * Returns null on any decode failure. Used by the binding-integrity check — the
210
+ * Returns null on any decode failure. Used by the binding-integrity check; the
158
211
  * row's denormalised `payload` jsonb is a convenience view projected from this
159
212
  * predicate at write time; if the view was altered after signing,
160
213
  * `buildPredicateForRow(...) !== decodePredicate(...)`.
@@ -166,22 +219,22 @@ export declare function decodePredicate(payloadBstr: Uint8Array): Record<string,
166
219
  * build-vault-claim.ts). This is the verifier-side mirror.
167
220
  *
168
221
  * Returns null when the row's payload is structurally insufficient (e.g.
169
- * SCHEMA_REGISTERED missing manifestDigest) — the caller surfaces null as a
222
+ * SCHEMA_REGISTERED missing manifestDigest); the caller surfaces null as a
170
223
  * binding mismatch rather than throwing, so an attacker who zeros out payload
171
224
  * can't crash the verifier.
172
225
  */
173
226
  export declare function buildPredicateForRow(recordId: string | null, entryType: string, payload: Record<string, unknown>): Record<string, unknown> | null;
174
227
  /**
175
228
  * Order-insensitive deep equality over plain JSON-shaped values. Used by the
176
- * binding-integrity check — the rebuilt and decoded predicates may serialize
229
+ * binding-integrity check: the rebuilt and decoded predicates may serialize
177
230
  * keys in different order across writer/reader paths.
178
231
  */
179
232
  export declare function deepEqual(a: unknown, b: unknown): boolean;
180
233
  /**
181
234
  * Strip envelope-level sibling fields (`on_behalf_of`, `traceparent`) from a
182
235
  * decoded predicate. They ride alongside per-kind predicate fields on the wire
183
- * but the engine's `buildPredicateOnly` — and our `buildPredicateForRow`
184
- * mirror — exclude them from the rebuilt predicate. Stripping here makes the
236
+ * but the engine's `buildPredicateOnly` (and our `buildPredicateForRow`
237
+ * mirror) exclude them from the rebuilt predicate. Stripping here makes the
185
238
  * two shapes deep-equalable; envelope-level integrity is covered by the
186
239
  * signature and the OIDC-actor cross-check.
187
240
  */
@@ -211,10 +264,10 @@ export declare function extractReceiptInclusionProof(receiptBytes: Uint8Array):
211
264
  * `signedStatementBytes`, assert it matches the COSE payload (the signed root).
212
265
  *
213
266
  * Returns:
214
- * - 'ok' — TS sig valid AND reconstructed root matches
215
- * - 'decode-fail' — envelope or VDP malformed
216
- * - 'signature-invalid' — TS signature fails (root cannot be trusted)
217
- * - 'root-mismatch' — reconstructed root != COSE payload (proof lies about
267
+ * - 'ok': TS sig valid AND reconstructed root matches
268
+ * - 'decode-fail': envelope or VDP malformed
269
+ * - 'signature-invalid': TS signature fails (root cannot be trusted)
270
+ * - 'root-mismatch': reconstructed root != COSE payload (proof lies about
218
271
  * which tree the leaf belongs to)
219
272
  * - 'unsupported-algorithm': the TS key commits to an algorithm this build
220
273
  * cannot compute. Fail closed: the Receipt may be
@@ -224,4 +277,3 @@ export type ReceiptVerifyOutcome = 'ok' | 'decode-fail' | 'signature-invalid' |
224
277
  export declare function verifyReceipt(receiptBytes: Uint8Array, signedStatementBytes: Uint8Array, tsPublicKeyBase64: string): ReceiptVerifyOutcome;
225
278
  export declare function merkleRoot(leaves: readonly string[]): string;
226
279
  export declare function verifyInclusion(leafHash: string, leafIndex: number, treeSize: number, path: readonly string[], expectedRoot: string): boolean;
227
- //# sourceMappingURL=primitives.d.ts.map
@@ -6,7 +6,7 @@
6
6
  * - Merkle: audit-vault/merkle.ts
7
7
  *
8
8
  * Re-implemented here (not imported from any engine/SDK code) so the verifier
9
- * has zero engine dependency — the load-bearing property of an offline
9
+ * has zero engine dependency, the load-bearing property of an offline
10
10
  * auditor: the engine could be compromised and this still verifies correctly.
11
11
  * The only runtime dependency is `cborg`, a general-purpose CBOR library (not
12
12
  * AGLedger code), and Node's built-in `crypto`. No network, no filesystem.
@@ -15,7 +15,7 @@
15
15
  * updated together; the conformance corpus (real engine output) is the
16
16
  * regression net that catches divergence.
17
17
  */
18
- import { createPublicKey, hash, verify } from 'node:crypto';
18
+ import { createPublicKey, getFips, hash, verify } from 'node:crypto';
19
19
  import { decode as cborDecode, encode as cborEncode, rfc8949EncodeOptions } from 'cborg';
20
20
  // --- SHA-256 ---
21
21
  /** sha256 over arbitrary bytes -> lowercase hex. */
@@ -41,6 +41,63 @@ const KEY_ALGORITHMS = {
41
41
  'ec:secp521r1': Object.freeze({ name: 'ES512', coseAlgs: Object.freeze([-36]), signatureLength: 132, verifiable: false, nodeKeyType: 'ec', namedCurve: 'secp521r1', digest: null, dsaEncoding: null }),
42
42
  'ec:secp256k1': Object.freeze({ name: 'ES256K', coseAlgs: Object.freeze([-47]), signatureLength: 64, verifiable: false, nodeKeyType: 'ec', namedCurve: 'secp256k1', digest: null, dsaEncoding: null }),
43
43
  };
44
+ /**
45
+ * Look up a table entry by its registry name (`Ed25519`, `ES256`, ...).
46
+ *
47
+ * Exists for the one question `resolveKeyAlgorithm` cannot answer: on a host
48
+ * that refuses to LOAD a key of some algorithm, there is no key object to
49
+ * resolve, yet that is exactly when a caller most needs to ask whether the
50
+ * algorithm is computable here. Pair with `runtimeCanCompute`.
51
+ */
52
+ export function algorithmByName(name) {
53
+ for (const alg of Object.values(KEY_ALGORITHMS)) {
54
+ if (alg.name === name)
55
+ return alg;
56
+ }
57
+ return null;
58
+ }
59
+ /**
60
+ * SPKI DER prefix for an Ed25519 public key: SEQUENCE(44) { SEQUENCE(5) {
61
+ * OID 1.3.101.112 } BIT STRING(33) }. RFC 8410 fixes the whole structure, so an
62
+ * Ed25519 SPKI is always these 12 bytes followed by the 32-byte key.
63
+ */
64
+ const ED25519_SPKI_PREFIX = Buffer.from('302a300506032b6570032100', 'hex');
65
+ const ED25519_SPKI_LENGTH = 44;
66
+ /**
67
+ * Whether these bytes DECLARE themselves an Ed25519 public key, judged without
68
+ * asking node:crypto to load them.
69
+ *
70
+ * Needed because a host that refuses EdDSA refuses at KEY LOAD, not only at
71
+ * verify: with the OpenSSL FIPS provider active, `createPublicKey` throws
72
+ * "Failed to read asymmetric key" and there is no key object left to resolve an
73
+ * algorithm from. Reading the OID separates "this is an Ed25519 key my runtime
74
+ * will not touch" from "these are garbage bytes", which is the difference
75
+ * between an environment problem and tamper. Structure only: it says nothing
76
+ * about whether the key is valid, trusted, or the right one.
77
+ *
78
+ * Byte-identical to the Python verifier's `looks_like_ed25519_key`, so the two
79
+ * implementations classify the same bytes the same way.
80
+ */
81
+ export function looksLikeEd25519Key(spkiDer) {
82
+ if (spkiDer.length !== ED25519_SPKI_LENGTH)
83
+ return false;
84
+ return Buffer.from(spkiDer).subarray(0, ED25519_SPKI_PREFIX.length).equals(ED25519_SPKI_PREFIX);
85
+ }
86
+ /**
87
+ * The narrow case where a key that would not LOAD must not read as tamper: the
88
+ * bytes declare Ed25519 by OID and this host cannot compute Ed25519 at all.
89
+ *
90
+ * Judged from the OID rather than from capability alone, so genuinely tampered
91
+ * key material still reads as tamper on every host, and both verifiers agree on
92
+ * garbage bytes. On a host that CAN compute Ed25519 this is always false, so an
93
+ * unloadable key there stays a signature failure exactly as before.
94
+ */
95
+ function isRuntimeRefusedEd25519Key(publicKeyBase64) {
96
+ const ed = KEY_ALGORITHMS['ed25519'];
97
+ if (!ed)
98
+ return false;
99
+ return looksLikeEd25519Key(Buffer.from(publicKeyBase64, 'base64')) && !runtimeCanCompute(ed);
100
+ }
44
101
  /** Small memo: a registry holds a handful of keys but chains hold millions of entries. */
45
102
  const KEY_ALG_CACHE = new Map();
46
103
  const KEY_ALG_CACHE_MAX = 256;
@@ -85,8 +142,12 @@ export function resolveKeyAlgorithm(publicKeyBase64) {
85
142
  *
86
143
  * Refuses non-Ed25519 keys. Node's `verify(null, ...)` silently falls back to
87
144
  * ECDSA/SHA-256 for EC keys, which would accept a signature no conformant
88
- * EdDSA verifier accepts (the engine guards the signing side the same way,
89
- * api#1089), so the key type is asserted before any crypto runs.
145
+ * EdDSA verifier accepts (the engine guards the signing side the same way),
146
+ * so the key type is asserted before any crypto runs.
147
+ *
148
+ * CAUTION for direct callers: as with `verifySignatureBytes`, `false` conflates
149
+ * "did not verify" with "this host cannot compute EdDSA". Check
150
+ * `runtimeCanCompute` first if that distinction matters to you.
90
151
  */
91
152
  export function verifyEd25519Bytes(publicKeyBase64, input, signature) {
92
153
  try {
@@ -104,6 +165,178 @@ export function verifyEd25519Bytes(publicKeyBase64, input, signature) {
104
165
  }
105
166
  }
106
167
  // --- Key-dispatched signature verification (Ed25519 + ES256) ---
168
+ /**
169
+ * Perform the actual verify() call for a resolved algorithm, WITHOUT catching.
170
+ *
171
+ * Split out from `verifySignatureBytes` so that two different failures stay
172
+ * distinguishable: a `false` return means the signature did not verify, while
173
+ * a throw means the host runtime could not perform the operation at all (see
174
+ * `runtimeCanCompute`). Collapsing those two into one boolean is what made a
175
+ * FIPS-locked host report an intact Ed25519 chain as forged.
176
+ *
177
+ * ES256 mirrors the engine's `verifyWithAlgorithm`: SHA-256 digest passed
178
+ * positionally, `dsaEncoding: 'ieee-p1363'` (COSE raw r||s, 64 bytes). The
179
+ * engine normalizes to low-S at sign time but, like the engine's verifier,
180
+ * high-S is accepted here: ECDSA malleability changes the envelope bytes,
181
+ * which the hash-link layer already pins.
182
+ */
183
+ function dispatchVerify(keyAlg, publicKeyBase64, input, signature) {
184
+ const keyObj = createPublicKey({
185
+ key: Buffer.from(publicKeyBase64, 'base64'),
186
+ format: 'der',
187
+ type: 'spki',
188
+ });
189
+ // Redundant with resolution from the same bytes, kept so a refactor that
190
+ // ever passes the algorithm in from elsewhere cannot reach Node's silent
191
+ // key-type-dispatched fallback.
192
+ if (keyObj.asymmetricKeyType !== keyAlg.nodeKeyType)
193
+ return false;
194
+ if (keyAlg.nodeKeyType === 'ec') {
195
+ if (keyObj.asymmetricKeyDetails?.namedCurve !== keyAlg.namedCurve)
196
+ return false;
197
+ if (keyAlg.digest === null || keyAlg.dsaEncoding === null)
198
+ return false;
199
+ return verify(keyAlg.digest, input, { key: keyObj, dsaEncoding: keyAlg.dsaEncoding }, signature);
200
+ }
201
+ return verify(null, input, keyObj, signature);
202
+ }
203
+ // --- Runtime algorithm capability (known-answer tests) ---
204
+ /**
205
+ * Fixed (key, message, signature) triples, one per `verifiable` algorithm,
206
+ * generated once with this package's own dispatch and checked in.
207
+ *
208
+ * They exist to answer a question the algorithm table cannot: `verifiable`
209
+ * says what this BUILD implements, which is only half of whether a signature
210
+ * can be checked. The other half is whether the HOST RUNTIME will perform the
211
+ * operation, and a runtime can refuse. An active OpenSSL FIPS provider
212
+ * carries no EdDSA, so `verify()` throws
213
+ * ERR_OSSL_EVP_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE for a perfectly good
214
+ * Ed25519 key.
215
+ *
216
+ * Deliberately fixed, self-contained bytes rather than a freshly generated
217
+ * keypair or anything read from the export under audit: promoting a signature
218
+ * failure to "not checked" is a security-relevant downgrade, so the signal
219
+ * that triggers it must be one no attacker can influence. Nothing in the
220
+ * audited data reaches this test.
221
+ */
222
+ const KAT_MESSAGE = Buffer.from('AGLedger verifier runtime known-answer test', 'utf8');
223
+ // Keyed on the frozen table entries themselves, not on `name`. A string-keyed
224
+ // map is one typo away from silently reverting this whole mechanism: a missing
225
+ // key reads as "no vector", the probe falls back to "supported", and every
226
+ // refusal goes back to reporting as a forged signature. There is no string to
227
+ // get wrong here, and the assertion below turns any remaining gap into a loud
228
+ // failure at import rather than a quiet downgrade at audit time.
229
+ const ALGORITHM_KATS = new Map([
230
+ [
231
+ KEY_ALGORITHMS['ed25519'],
232
+ {
233
+ spkiBase64: 'MCowBQYDK2VwAyEAjChcTn8MOj5h5PpKz/+MvHfomativmvfmC1zV5Sczfo=',
234
+ signatureBase64: 'iinDVfJ5uwoE4aWjLhunX340+yPlu4l2S8RFG+IfXqzWoiIXYL/ND7+ouGVzAnejozCErkL9GneR1sc3vY1sAg==',
235
+ },
236
+ ],
237
+ [
238
+ KEY_ALGORITHMS['ec:prime256v1'],
239
+ {
240
+ spkiBase64: 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEEyJ40hViXjp41rIWYdbJT9bUHWVjYWpsOLKdc4F1L+c4reEK7WmCx1fI4sl0okBN/lNvhZT+0HZ44aUw5HKmFA==',
241
+ signatureBase64: 'eQ8fKfXT5GuBUz7gueqcq9hTmzrJlSuaoF/ukCPtKJsxqrynVgIREn/XMPKbdSHp7wMyFOEAgmbVfoMDnR5x/Q==',
242
+ },
243
+ ],
244
+ ]);
245
+ // Every algorithm this build claims to compute must carry a vector proving the
246
+ // host can compute it. Failing at import is the point: a packaging slip here
247
+ // would otherwise surface as silently unverified audit chains.
248
+ for (const alg of Object.values(KEY_ALGORITHMS)) {
249
+ if (alg.verifiable && !ALGORITHM_KATS.has(alg)) {
250
+ throw new Error(`@agledger/verify-core packaging error: ${alg.name} is marked verifiable but carries no known-answer vector.`);
251
+ }
252
+ }
253
+ /** One probe per algorithm per process; the answer cannot change mid-run. */
254
+ const RUNTIME_SUPPORT_CACHE = new Map();
255
+ /**
256
+ * Whether the host runtime can actually compute `keyAlg`, proven by running
257
+ * this build's own dispatch against a known-good signature.
258
+ *
259
+ * A throw and a `false` are treated identically: either way the runtime just
260
+ * failed to confirm a signature known to be valid, so it cannot be trusted to
261
+ * tell a good signature from a forged one. Fail closed, and callers must
262
+ * surface this as "NOT verified, verify elsewhere", never as a pass and never
263
+ * as tamper evidence.
264
+ */
265
+ export function runtimeCanCompute(keyAlg) {
266
+ if (!keyAlg.verifiable)
267
+ return false;
268
+ const kat = ALGORITHM_KATS.get(keyAlg);
269
+ // Unreachable for table entries (the import-time assertion above). A caller
270
+ // that fabricated its own KeyAlgorithm lands here: fail closed, and do not
271
+ // memoize, so a hostile or buggy consumer cannot poison the answer that
272
+ // real verification depends on.
273
+ if (!kat)
274
+ return false;
275
+ const cached = RUNTIME_SUPPORT_CACHE.get(keyAlg);
276
+ if (cached !== undefined)
277
+ return cached;
278
+ let supported;
279
+ try {
280
+ supported = dispatchVerify(keyAlg, kat.spkiBase64, KAT_MESSAGE, Buffer.from(kat.signatureBase64, 'base64'));
281
+ }
282
+ catch {
283
+ supported = false;
284
+ }
285
+ RUNTIME_SUPPORT_CACHE.set(keyAlg, supported);
286
+ return supported;
287
+ }
288
+ /**
289
+ * Human-readable reason an algorithm could not be computed, for the detail
290
+ * line of CHAIN_UNSUPPORTED_ALGORITHM. Distinguishes the two causes that share
291
+ * that failure code, because they have different remedies: upgrade the
292
+ * verifier, versus re-run somewhere the algorithm is permitted.
293
+ */
294
+ export function describeUnsupportedAlgorithm(publicKeyBase64) {
295
+ const keyAlg = resolveKeyAlgorithm(publicKeyBase64);
296
+ // Same reachability trap as `verifyCoseSign1`: on the host this sentence
297
+ // exists for, the key never loaded, so there is no algorithm to resolve and
298
+ // the generic "upgrade the verifier" text would send an auditor after a build
299
+ // that is fine. Answer from the OID instead.
300
+ if (typeof keyAlg !== 'object' && isRuntimeRefusedEd25519Key(publicKeyBase64)) {
301
+ return describeRuntimeRefusal(KEY_ALGORITHMS['ed25519']);
302
+ }
303
+ if (typeof keyAlg !== 'object') {
304
+ return 'commits to an algorithm this verifier build cannot compute. The chain is NOT verified; upgrade the verifier.';
305
+ }
306
+ if (!keyAlg.verifiable) {
307
+ return `commits to ${keyAlg.name}, which this verifier build cannot compute. The chain is NOT verified; upgrade the verifier.`;
308
+ }
309
+ if (runtimeCanCompute(keyAlg)) {
310
+ // No gap applies. Reached only by an external caller asking about a key
311
+ // that verifies fine here, so say that rather than inventing a refusal:
312
+ // this is exported API and its answer must not depend on the caller
313
+ // having checked the precondition first.
314
+ return `commits to ${keyAlg.name}, which this verifier build and this host can both compute. No algorithm gap applies to this key.`;
315
+ }
316
+ return describeRuntimeRefusal(keyAlg);
317
+ }
318
+ /** The host-refused-this-algorithm sentence, shared by both ways of reaching it. */
319
+ function describeRuntimeRefusal(keyAlg) {
320
+ // The FIPS clause names a missing EdDSA implementation, so it belongs only
321
+ // to EdDSA. A FIPS provider carries ECDSA P-256 quite happily, and telling
322
+ // an ES256 auditor that EdDSA is absent sends them somewhere useless.
323
+ const cause = isFipsActive() && keyAlg.name === 'Ed25519'
324
+ ? ' because the OpenSSL FIPS provider is active, and it carries no EdDSA.'
325
+ : '.';
326
+ return (`commits to ${keyAlg.name}, which this verifier build supports but this HOST RUNTIME refused to compute` +
327
+ cause +
328
+ ' This is NOT tamper evidence: the signature was never checked, so the chain is neither verified nor refuted.' +
329
+ ' Re-run the verification on a host without that restriction.');
330
+ }
331
+ /** Best-effort FIPS detection, used only to explain a failure, never to gate one. */
332
+ function isFipsActive() {
333
+ try {
334
+ return getFips() === 1;
335
+ }
336
+ catch {
337
+ return false;
338
+ }
339
+ }
107
340
  /**
108
341
  * Verify a raw signature under whatever algorithm the TRUSTED key commits to.
109
342
  * Generalizes `verifyEd25519Bytes`: the algorithm is resolved from the SPKI
@@ -117,37 +350,26 @@ export function verifyEd25519Bytes(publicKeyBase64, input, signature) {
117
350
  * engine normalizes to low-S at sign time but, like the engine's verifier,
118
351
  * high-S is accepted here: ECDSA malleability changes the envelope bytes,
119
352
  * which the hash-link layer already pins.
353
+ *
354
+ * CAUTION for direct callers: `false` here means "did not verify" OR "this
355
+ * host cannot compute the algorithm", which are opposite conclusions.
356
+ * `verifyCoseSign1` gates on `runtimeCanCompute` before ever reaching this,
357
+ * so it never conflates them; anything calling this primitive directly must
358
+ * do the same check itself or risk reporting an intact signature as forged.
120
359
  */
121
360
  export function verifySignatureBytes(publicKeyBase64, input, signature) {
122
361
  const keyAlg = resolveKeyAlgorithm(publicKeyBase64);
123
362
  if (typeof keyAlg !== 'object' || !keyAlg.verifiable)
124
363
  return false;
125
364
  try {
126
- const keyObj = createPublicKey({
127
- key: Buffer.from(publicKeyBase64, 'base64'),
128
- format: 'der',
129
- type: 'spki',
130
- });
131
- // Redundant with resolution from the same bytes, kept so a refactor that
132
- // ever passes the algorithm in from elsewhere cannot reach Node's silent
133
- // key-type-dispatched fallback (the api#1089 trap).
134
- if (keyObj.asymmetricKeyType !== keyAlg.nodeKeyType)
135
- return false;
136
- if (keyAlg.nodeKeyType === 'ec') {
137
- if (keyObj.asymmetricKeyDetails?.namedCurve !== keyAlg.namedCurve)
138
- return false;
139
- if (keyAlg.digest === null || keyAlg.dsaEncoding === null)
140
- return false;
141
- return verify(keyAlg.digest, input, { key: keyObj, dsaEncoding: keyAlg.dsaEncoding }, signature);
142
- }
143
- return verify(null, input, keyObj, signature);
365
+ return dispatchVerify(keyAlg, publicKeyBase64, input, signature);
144
366
  }
145
367
  catch {
146
368
  return false;
147
369
  }
148
370
  }
149
371
  // --- COSE_Sign1 (RFC 9052 §4.4) verification ---
150
- /** CBOR tag 18 — tagged COSE_Sign1 envelope. */
372
+ /** CBOR tag 18: tagged COSE_Sign1 envelope. */
151
373
  const COSE_SIGN1_TAG = 18;
152
374
  /** CBOR major type 6 (tag), value 18, short form: the required leading byte. */
153
375
  const COSE_SIGN1_TAG_PREFIX = 0xd2;
@@ -190,14 +412,25 @@ export function verifyCoseSign1(coseSign1, publicKeyBase64) {
190
412
  const keyAlg = resolveKeyAlgorithm(publicKeyBase64);
191
413
  // A key that does not parse can verify nothing; preserve the historical
192
414
  // 'invalid' rather than misreporting garbage bytes as an algorithm gap.
193
- if (keyAlg === 'unparseable')
194
- return 'invalid';
415
+ //
416
+ // One exception, and it is deliberately narrow: bytes that DECLARE themselves
417
+ // an Ed25519 key (by OID) on a host that cannot compute EdDSA. A FIPS-locked
418
+ // runtime refuses such a key at LOAD, so "did not parse" there means "this
419
+ // host will not touch it", not "someone forged it". Without this, the whole
420
+ // runtime-capability gate below is unreachable on the one path it was
421
+ // written for, and an intact chain still reads as tamper.
422
+ if (keyAlg === 'unparseable') {
423
+ return isRuntimeRefusedEd25519Key(publicKeyBase64) ? 'unsupported-key-algorithm' : 'invalid';
424
+ }
195
425
  if (keyAlg === 'unrecognized')
196
426
  return 'unsupported-key-algorithm';
197
427
  const headerAlg = extractHeaderAlg(parts.protectedBstr);
198
428
  if (headerAlg === null || !keyAlg.coseAlgs.includes(headerAlg))
199
429
  return 'alg-mismatch';
200
- if (!keyAlg.verifiable)
430
+ // Two independent reasons the signature cannot be checked: this build does
431
+ // not implement the algorithm, or the host runtime refuses to compute it.
432
+ // Both must read as "not verified", never as "did not verify".
433
+ if (!keyAlg.verifiable || !runtimeCanCompute(keyAlg))
201
434
  return 'unsupported-key-algorithm';
202
435
  if (parts.signature.length === keyAlg.signatureLength &&
203
436
  parts.signature.every((b) => b === 0)) {
@@ -232,7 +465,7 @@ function extractHeaderAlg(protectedBstr) {
232
465
  * hex, matching the engine's `vault_signing_keys.key_id` shape. Returns null
233
466
  * when absent or malformed. The caller cross-checks it against the row's
234
467
  * `signingKeyId` column: the column is a denormalized convenience, the kid is
235
- * signed, so a rewritten column surfaces as drift (engine mirror: #893).
468
+ * signed, so a rewritten column surfaces as drift (engine mirror: signing_key_drift).
236
469
  */
237
470
  export function extractKid(protectedBstr) {
238
471
  try {
@@ -323,7 +556,7 @@ export function extractTraceparentClaim(payloadBstr) {
323
556
  /**
324
557
  * Decode the predicate object from a COSE_Sign1 payload bstr. The payload IS
325
558
  * the in-toto v1 Statement; the predicate body lives at `payload.predicate`.
326
- * Returns null on any decode failure. Used by the binding-integrity check — the
559
+ * Returns null on any decode failure. Used by the binding-integrity check; the
327
560
  * row's denormalised `payload` jsonb is a convenience view projected from this
328
561
  * predicate at write time; if the view was altered after signing,
329
562
  * `buildPredicateForRow(...) !== decodePredicate(...)`.
@@ -365,7 +598,7 @@ const RECORD_STATE_RESERVED_KEYS = new Set([
365
598
  * build-vault-claim.ts). This is the verifier-side mirror.
366
599
  *
367
600
  * Returns null when the row's payload is structurally insufficient (e.g.
368
- * SCHEMA_REGISTERED missing manifestDigest) — the caller surfaces null as a
601
+ * SCHEMA_REGISTERED missing manifestDigest); the caller surfaces null as a
369
602
  * binding mismatch rather than throwing, so an attacker who zeros out payload
370
603
  * can't crash the verifier.
371
604
  */
@@ -445,7 +678,7 @@ function buildSchemaEventPredicateForRow(entryType, payload) {
445
678
  }
446
679
  /**
447
680
  * Order-insensitive deep equality over plain JSON-shaped values. Used by the
448
- * binding-integrity check — the rebuilt and decoded predicates may serialize
681
+ * binding-integrity check: the rebuilt and decoded predicates may serialize
449
682
  * keys in different order across writer/reader paths.
450
683
  */
451
684
  export function deepEqual(a, b) {
@@ -485,8 +718,8 @@ export function deepEqual(a, b) {
485
718
  /**
486
719
  * Strip envelope-level sibling fields (`on_behalf_of`, `traceparent`) from a
487
720
  * decoded predicate. They ride alongside per-kind predicate fields on the wire
488
- * but the engine's `buildPredicateOnly` — and our `buildPredicateForRow`
489
- * mirror — exclude them from the rebuilt predicate. Stripping here makes the
721
+ * but the engine's `buildPredicateOnly` (and our `buildPredicateForRow`
722
+ * mirror) exclude them from the rebuilt predicate. Stripping here makes the
490
723
  * two shapes deep-equalable; envelope-level integrity is covered by the
491
724
  * signature and the OIDC-actor cross-check.
492
725
  */
@@ -680,4 +913,3 @@ export function verifyInclusion(leafHash, leafIndex, treeSize, path, expectedRoo
680
913
  }
681
914
  return current === expectedRoot && pathPos === path.length;
682
915
  }
683
- //# sourceMappingURL=primitives.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agledger/verify-core",
3
- "version": "1.3.0",
3
+ "version": "1.4.1",
4
4
  "description": "Shared offline verification core for AGLedger audit chains: COSE_Sign1 (RFC 9052) decode/verify, Ed25519 + ES256, hash-chain walk, Merkle proofs, and the canonical failure taxonomy. One dependency (cborg); no network. The single source of truth the SDK, CLI, MCP server, and @agledger/verify all build on.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -17,6 +17,7 @@
17
17
  },
18
18
  "files": [
19
19
  "dist",
20
+ "!dist/**/*.map",
20
21
  "LICENSE",
21
22
  "README.md"
22
23
  ],
@@ -46,6 +47,9 @@
46
47
  "type": "git",
47
48
  "url": "git+https://github.com/agledger-ai/verify-core.git"
48
49
  },
50
+ "bugs": {
51
+ "url": "https://github.com/agledger-ai/verify-core/issues"
52
+ },
49
53
  "publishConfig": {
50
54
  "access": "public"
51
55
  },
@@ -1 +0,0 @@
1
- {"version":3,"file":"audit-export.d.ts","sourceRoot":"","sources":["../src/audit-export.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAGL,KAAK,kBAAkB,EAEvB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EAEtB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,+CAA+C;AAC/C,MAAM,WAAW,qBAAqB;IACpC,+FAA+F;IAC/F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qFAAqF;IACrF,SAA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,CAAC,SAAS,EAAE,CAAC;QAClB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC1C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,OAAO,GAAG,OAAO,EAAE,CAAC;YAChD,OAAO;gBACL,IAAI,EAAE,mBAAmB;gBACzB,MAAM,EAAE,iBAAiB,SAAS,kBAAkB,GAAG,CAAC,KAAK,eAAe,GAAG,CAAC,SAAS,GAAG;aAC7F,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"failures.d.ts","sourceRoot":"","sources":["../src/failures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,MAAM,MAAM,WAAW,GAEnB,oBAAoB,GACpB,aAAa,GAEb,oBAAoB,GACpB,uBAAuB,GACvB,mBAAmB,GACnB,qBAAqB,GACrB,uBAAuB,GACvB,0BAA0B,GAC1B,4BAA4B,GAC5B,gCAAgC,GAChC,2BAA2B,GAC3B,yBAAyB,GACzB,6BAA6B,GAC7B,4BAA4B,GAC5B,mBAAmB,GACnB,0BAA0B,GAC1B,oBAAoB,GACpB,6BAA6B,GAC7B,yBAAyB,GAEzB,wBAAwB,GACxB,0BAA0B,GAC1B,8BAA8B,GAE9B,gCAAgC,GAChC,4BAA4B,GAC5B,+BAA+B,GAC/B,uCAAuC,GACvC,iCAAiC,GACjC,qCAAqC,GACrC,wBAAwB,CAAC;AAmE7B,mDAAmD;AACnD,wBAAgB,UAAU,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAEpD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"failures.js","sourceRoot":"","sources":["../src/failures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAqCH;;;G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