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

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

Issue 806913006: [WebCrypto] Move LayoutTests from crypto to crypto/subtle (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update path for deserialize legacy tests Created 6 years 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-kw-wrap-unwrap-aes.html
diff --git a/LayoutTests/crypto/aes-kw-wrap-unwrap-aes.html b/LayoutTests/crypto/aes-kw-wrap-unwrap-aes.html
deleted file mode 100644
index 0722f447f6ad9a75928d743bfbc99fe2b1280037..0000000000000000000000000000000000000000
--- a/LayoutTests/crypto/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>
« no previous file with comments | « LayoutTests/crypto/aes-kw-key-manipulation-expected.txt ('k') | LayoutTests/crypto/aes-kw-wrap-unwrap-aes-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698