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

Unified Diff: LayoutTests/crypto/subtle/hkdf-deriveKey.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/hkdf-deriveKey.html
diff --git a/LayoutTests/crypto/subtle/hkdf-deriveKey.html b/LayoutTests/crypto/subtle/hkdf-deriveKey.html
deleted file mode 100644
index 949503cb86ef59c1b5d9b04f9374696622a4239a..0000000000000000000000000000000000000000
--- a/LayoutTests/crypto/subtle/hkdf-deriveKey.html
+++ /dev/null
@@ -1,68 +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 that keys can be derived from an HKDF key");
-
-jsTestIsAsync = true;
-
-kHkdfKey = "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b";
-
-var extractable = true;
-var derivingKeyAlgorithm = {
- name: "HKDF",
- hash: "SHA-256",
- salt: new Uint8Array(),
- info: new Uint8Array()
-};
-
-Promise.resolve(null).then(function(result) {
- return crypto.subtle.importKey("raw", hexStringToUint8Array(kHkdfKey), "HKDF", extractable, ['deriveKey']);
-}).then(function(result) {
- baseKey = result;
-
- return crypto.subtle.deriveKey(derivingKeyAlgorithm, baseKey, {name: "AES-GCM", length: 256}, extractable, ['encrypt']);
-}).then(function(result) {
- derivedKey = result;
-
- shouldEvaluateAs("derivedKey.type", "secret");
- shouldEvaluateAs("derivedKey.extractable", extractable);
- shouldEvaluateAs("derivedKey.algorithm.name", "AES-GCM");
- shouldEvaluateAs("derivedKey.usages.join(',')", "encrypt");
-
- debug("\nTry to derive an HKDF key...");
- return crypto.subtle.deriveKey(derivingKeyAlgorithm, baseKey, "HKDF", extractable, ['deriveKey']);
-}).then(failAndFinishJSTest, function(result) {
- logError(result);
-
- // Create an empty key and test deriving a key with it.
- return crypto.subtle.importKey("raw", new Uint8Array(), "HKDF", extractable, ['deriveKey']);
-}).then(function(result) {
- emptyKey = result;
-
- shouldEvaluateAs("emptyKey.type", "secret");
- shouldEvaluateAs("emptyKey.extractable", extractable);
- shouldEvaluateAs("emptyKey.algorithm.name", "HKDF");
- shouldEvaluateAs("emptyKey.usages.join(',')", "deriveKey");
-
- return crypto.subtle.deriveKey(derivingKeyAlgorithm, emptyKey, {name: "AES-GCM", length: 256}, extractable, ['encrypt']);
-}).then(function(result) {
- derivedKey = result;
-
- shouldEvaluateAs("derivedKey.type", "secret");
- shouldEvaluateAs("derivedKey.extractable", extractable);
- shouldEvaluateAs("derivedKey.algorithm.name", "AES-GCM");
- shouldEvaluateAs("derivedKey.usages.join(',')", "encrypt");
-}).then(finishJSTest, failAndFinishJSTest);
-
-</script>
-
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698