Loading src/dnt.ts +5 −0 Original line number Diff line number Diff line Loading @@ -119,6 +119,11 @@ await build({ diagnostic.file?.fileName.endsWith("2KNRVU.ts") ) { return false; // ignore all diagnostics in this file } else if ( diagnostic.code === 2315 && diagnostic.messageText === "Type 'Uint8Array' is not generic." ) { return false; } // etc... more checks here return true; Loading src/federation/kv.test.ts +1 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ test("MemoryKvStore", async (t) => { await store.set(["foo", "baz"], "baz", { ttl: Temporal.Duration.from({ seconds: 0 }), }); await new Promise((resolve) => setTimeout(resolve, 10)); assertEquals(await store.get(["foo", "baz"]), undefined); }); Loading src/runtime/key.ts +6 −3 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ const algorithms: Record< */ export async function importSpki(pem: string): Promise<CryptoKey> { pem = pem.replace(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, ""); let spki: Uint8Array; let spki: Uint8Array<ArrayBuffer>; try { spki = decodeBase64(pem); } catch (_) { Loading Loading @@ -111,7 +111,10 @@ export async function importMultibaseKey(key: string): Promise<CryptoKey> { format: "der", type: "pkcs1", }); const spki = keyObject.export({ type: "spki", format: "der" }).buffer; const exported = keyObject.export({ type: "spki", format: "der" }).buffer; const spki = exported instanceof Uint8Array ? exported : new Uint8Array(exported); return await crypto.subtle.importKey( "spki", new Uint8Array(spki), Loading @@ -122,7 +125,7 @@ export async function importMultibaseKey(key: string): Promise<CryptoKey> { } else if (code === 0xed) { // ed25519-pub return await crypto.subtle.importKey( "raw", content, content.slice(), "Ed25519", true, ["verify"], Loading src/sig/ld.ts +2 −2 Original line number Diff line number Diff line Loading @@ -313,7 +313,7 @@ export async function verifySignature( const verified = await crypto.subtle.verify( "RSASSA-PKCS1-v1_5", key.publicKey, signature, signature.slice(), messageBytes, ); if (verified) return key; Loading @@ -339,7 +339,7 @@ export async function verifySignature( const verified = await crypto.subtle.verify( "RSASSA-PKCS1-v1_5", key.publicKey, signature, signature.slice(), messageBytes, ); return verified ? key : null; Loading src/sig/proof.ts +1 −1 Original line number Diff line number Diff line Loading @@ -352,7 +352,7 @@ async function verifyProofInternal( const verified = await crypto.subtle.verify( "Ed25519", publicKey.publicKey, proof.proofValue, proof.proofValue.slice(), digest, ); if (!verified) { Loading Loading
src/dnt.ts +5 −0 Original line number Diff line number Diff line Loading @@ -119,6 +119,11 @@ await build({ diagnostic.file?.fileName.endsWith("2KNRVU.ts") ) { return false; // ignore all diagnostics in this file } else if ( diagnostic.code === 2315 && diagnostic.messageText === "Type 'Uint8Array' is not generic." ) { return false; } // etc... more checks here return true; Loading
src/federation/kv.test.ts +1 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ test("MemoryKvStore", async (t) => { await store.set(["foo", "baz"], "baz", { ttl: Temporal.Duration.from({ seconds: 0 }), }); await new Promise((resolve) => setTimeout(resolve, 10)); assertEquals(await store.get(["foo", "baz"]), undefined); }); Loading
src/runtime/key.ts +6 −3 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ const algorithms: Record< */ export async function importSpki(pem: string): Promise<CryptoKey> { pem = pem.replace(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g, ""); let spki: Uint8Array; let spki: Uint8Array<ArrayBuffer>; try { spki = decodeBase64(pem); } catch (_) { Loading Loading @@ -111,7 +111,10 @@ export async function importMultibaseKey(key: string): Promise<CryptoKey> { format: "der", type: "pkcs1", }); const spki = keyObject.export({ type: "spki", format: "der" }).buffer; const exported = keyObject.export({ type: "spki", format: "der" }).buffer; const spki = exported instanceof Uint8Array ? exported : new Uint8Array(exported); return await crypto.subtle.importKey( "spki", new Uint8Array(spki), Loading @@ -122,7 +125,7 @@ export async function importMultibaseKey(key: string): Promise<CryptoKey> { } else if (code === 0xed) { // ed25519-pub return await crypto.subtle.importKey( "raw", content, content.slice(), "Ed25519", true, ["verify"], Loading
src/sig/ld.ts +2 −2 Original line number Diff line number Diff line Loading @@ -313,7 +313,7 @@ export async function verifySignature( const verified = await crypto.subtle.verify( "RSASSA-PKCS1-v1_5", key.publicKey, signature, signature.slice(), messageBytes, ); if (verified) return key; Loading @@ -339,7 +339,7 @@ export async function verifySignature( const verified = await crypto.subtle.verify( "RSASSA-PKCS1-v1_5", key.publicKey, signature, signature.slice(), messageBytes, ); return verified ? key : null; Loading
src/sig/proof.ts +1 −1 Original line number Diff line number Diff line Loading @@ -352,7 +352,7 @@ async function verifyProofInternal( const verified = await crypto.subtle.verify( "Ed25519", publicKey.publicKey, proof.proofValue, proof.proofValue.slice(), digest, ); if (!verified) { Loading