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

Unified Diff: LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html

Issue 957713004: [WebCrypto] Split LayoutTests/crypto/subtle into per-algorithm directories (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated to latest master Created 5 years, 10 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/subtle/aes-kw-wrap-unwrap-aes.html
diff --git a/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html b/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html
deleted file mode 100644
index 4c66483d636c086597fb5cd7a08b62fc12fb8598..0000000000000000000000000000000000000000
--- a/LayoutTests/crypto/subtle/aes-kw-wrap-unwrap-aes.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<!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 wrapping and unwrapping keys with AES-KW.");
-
-jsTestIsAsync = true;
-
-var kekData = hexStringToUint8Array("000102030405060708090A0B0C0D0E0F");
-var keyData = hexStringToUint8Array("00112233445566778899AABBCCDDEEFF");
-var extractable = true;
-
-debug("Importing key encryption key...");
-crypto.subtle.importKey("raw", kekData, {name: "aes-kw"}, extractable, ["wrapKey", "unwrapKey"]).then(function(result) {
- kek = result;
-
- debug("Importing a key to be wrapped...");
- return crypto.subtle.importKey("raw", keyData, {name: "aes-cbc"}, extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]);
-}).then(function(result) {
- key = result;
-
- debug("Wrapping it...");
- return crypto.subtle.wrapKey("raw", key, kek, {name: "aes-kw"});
-}).then(function(result) {
- wrappedKey = result;
- shouldBe("bytesToHexString(wrappedKey)", "'1fa68b0a8112b447aef34bd8fb5a7b829d3e862371d2cfe5'"); // Result from RFC 3394.
-
- debug("Unwrapping it...");
- return crypto.subtle.unwrapKey("raw", wrappedKey, kek, {name: "aes-kw"}, {name: "aes-cbc"}, extractable, ["encrypt", "decrypt", "wrapKey", "unwrapKey"]);
-}).then(function(result) {
- unwrappedKey = result;
- shouldBe("unwrappedKey.toString()", "'[object CryptoKey]'");
- shouldBe("unwrappedKey.type", "'secret'");
- shouldBe("unwrappedKey.extractable", "true");
- shouldBe("unwrappedKey.algorithm.name", "'AES-CBC'");
- shouldBe("unwrappedKey.algorithm.length", "128");
- shouldBe("unwrappedKey.usages", "['encrypt', 'decrypt', 'wrapKey', 'unwrapKey']");
-
- debug("Exporting it...");
- return crypto.subtle.exportKey("raw", unwrappedKey);
-}).then(function(result) {
- unwrappedKeyData = result;
- shouldBe("bytesToHexString(unwrappedKeyData)", "bytesToHexString(keyData)");
-
- finishJSTest();
-});
-</script>
-
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698