Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Unified Diff: LayoutTests/crypto/aes-cbc-unwrap-failure.html

Issue 298023002: [webcrypto] Import WebKit's webcrypto tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove FIXME for unrecognized jwk usages (supported now) Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/crypto/aes-cbc-unwrap-failure.html
diff --git a/LayoutTests/crypto/aes-cbc-unwrap-failure.html b/LayoutTests/crypto/aes-cbc-unwrap-failure.html
new file mode 100644
index 0000000000000000000000000000000000000000..8b478bdf2505359baf914ffdc8a051eda23ab888
--- /dev/null
+++ b/LayoutTests/crypto/aes-cbc-unwrap-failure.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../resources/js-test.js"></script>
+<script src="resources/common.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+description("Test unwrapping an RSA key with AES-CBC.");
+
+jsTestIsAsync = true;
+
+var extractable = true;
+var nonExtractable = false;
+
+var unwrappingKeyOctets = hexStringToUint8Array("2a00e0e776e94e4dc89bf947cebdebe1");
+var wrappedKey = hexStringToUint8Array("b490dedb3abc3fd545e146538e6cc3ca"); // An empty encrypted JSON.
+
+debug("Importing an unwrapping key...");
+crypto.subtle.importKey("raw", unwrappingKeyOctets, {name: "AES-CBC"}, nonExtractable, ["unwrapKey"]).then(function(result) {
+ unwrappingKey = result;
+ shouldBe("unwrappingKey.algorithm.name", "'AES-CBC'");
+ var unwrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030405060708090a0b0c0d0e0f")};
+ debug("Unwrapping a key...");
+ var importAlgorithm = {name: 'RSASSA-PKCS1-v1_5', hash: {name: 'sha-1'} };
+ return crypto.subtle.unwrapKey("jwk", wrappedKey, unwrappingKey, unwrapAlgorithm, importAlgorithm, extractable, ["sign"]);
+}).then(undefined, function(result) {
+ logError(result);
+ finishJSTest();
+}).then(finishJSTest, failAndFinishJSTest);
+
+</script>
+
+</body>
+</html>
« no previous file with comments | « LayoutTests/crypto/aes-cbc-invalid-length-expected.txt ('k') | LayoutTests/crypto/aes-cbc-unwrap-failure-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698