diff options
| author | Luca Casonato <hello@lcas.dev> | 2024-09-16 13:04:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-16 11:04:40 +0000 |
| commit | 81c9e0ba25acb6288330b85ba2c558f587d92782 (patch) | |
| tree | 3d53f6a17f8a42f20ec20fba3cc98360e32df18b /tests/unit_node/crypto | |
| parent | eb8ee95f08186c948e5b83501cedd59d6e3b4ef2 (diff) | |
fix(ext/crypto): support md4 digest algorithm (#25656)
Fixes #25646
Diffstat (limited to 'tests/unit_node/crypto')
| -rw-r--r-- | tests/unit_node/crypto/crypto_sign_test.ts | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/tests/unit_node/crypto/crypto_sign_test.ts b/tests/unit_node/crypto/crypto_sign_test.ts index c33c9758f..97c80b28a 100644 --- a/tests/unit_node/crypto/crypto_sign_test.ts +++ b/tests/unit_node/crypto/crypto_sign_test.ts @@ -154,16 +154,21 @@ Deno.test("crypto.createSign|sign - compare with node", async (t) => { new URL(import.meta.resolve("../testdata/rsa_private.pem")), ); for (const { digest, signature } of fixtures) { - await t.step(digest, () => { - let actual: string | null; - try { - const s = createSign(digest); - s.update(DATA); - actual = s.sign(privateKey).toString("hex"); - } catch { - actual = null; - } - assertEquals(actual, signature); + await t.step({ + name: digest, + // TODO(lucacasonato): our md4 implementation does not have an OID, so it can't sign/verify + ignore: digest.toLowerCase().includes("md4"), + fn: () => { + let actual: string | null; + try { + const s = createSign(digest); + s.update(DATA); + actual = s.sign(privateKey).toString("hex"); + } catch { + actual = null; + } + assertEquals(actual, signature); + }, }); } }); @@ -176,7 +181,8 @@ Deno.test("crypto.createVerify|verify - compare with node", async (t) => { for (const { digest, signature } of fixtures) { await t.step({ name: digest, - ignore: signature === null, + // TODO(lucacasonato): our md4 implementation does not have an OID, so it can't sign/verify + ignore: signature === null || digest.toLowerCase().includes("md4"), fn: () => { const s = createVerify(digest); s.update(DATA); |
