LibWeb: Fix crash when importing malformed RSAOAEP key

This fixes a crash in WPT:
WebCryptoAPI/import_export/rsa_importKey.https.any

This allows us to pass 240 tests!
This commit is contained in:
Ben Wiederhake 2024-10-25 05:38:46 +02:00 committed by Jelle Raaijmakers
commit 124bd115a1
Notes: github-actions[bot] 2024-10-25 22:15:38 +00:00
3 changed files with 33 additions and 4 deletions

View file

@ -0,0 +1,23 @@
<!DOCTYPE html>
<script src="../include.js"></script>
<script>
asyncTest(async done => {
var subtle = self.crypto.subtle;
var key = await subtle.importKey(
"jwk",
{
kty: "RSA",
n: "zZn4sRGfjQos56yL_Qy1R9NI-THMnFynn94g5RxA6wGrJh4BJT3x6I9x0IbpS3q-d4ORA6R2vuDMh8dDFRr9RDH6XY-gUScc9U5Jz3UA2KmVfsCbnUPvcAmMV_ENA7_TF0ivVjuIFodyDTx7EKHNVTrHHSlrbt7spbmcivs23Zc",
e: "AQAB",
},
{ name: "RSA-OAEP", hash: "SHA-1" },
true,
["encrypt", "wrapKey"]
);
println(key.extractable);
println(key.algorithm.name);
println(key.algorithm.hash);
println(key.algorithm.publicExponent);
done();
});
</script>