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

Unified Diff: third_party/WebKit/LayoutTests/crypto/subtle/pbkdf2/importKey-failures.html

Issue 2289033002: Require extractable=false for KDF import (Closed)
Patch Set: update another test Created 4 years, 3 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: third_party/WebKit/LayoutTests/crypto/subtle/pbkdf2/importKey-failures.html
diff --git a/third_party/WebKit/LayoutTests/crypto/subtle/hkdf/importKey-failures.html b/third_party/WebKit/LayoutTests/crypto/subtle/pbkdf2/importKey-failures.html
similarity index 57%
copy from third_party/WebKit/LayoutTests/crypto/subtle/hkdf/importKey-failures.html
copy to third_party/WebKit/LayoutTests/crypto/subtle/pbkdf2/importKey-failures.html
index b010c4de4b49250ffe5a85b57e5a0ae8cf9cc5f5..a811c450d8f0d9399160e1a1d7aae8e8fae905c2 100644
--- a/third_party/WebKit/LayoutTests/crypto/subtle/hkdf/importKey-failures.html
+++ b/third_party/WebKit/LayoutTests/crypto/subtle/pbkdf2/importKey-failures.html
@@ -9,37 +9,42 @@
<div id="console"></div>
<script>
-description("Test inputs to HKDF importKey()");
+description("Test bad inputs to PKBDF2 importKey()");
jsTestIsAsync = true;
-var extractable = true;
+var extractable = false;
rawBytes = new Uint8Array([1, 2]);
var p = Promise.resolve(null);
p.then(function() {
debug("\nimportKey() with 'encrypt' usage...");
- return crypto.subtle.importKey("raw", rawBytes, "HKDF", extractable, ['encrypt']);
+ return crypto.subtle.importKey("raw", rawBytes, "PBKDF2", extractable, ['encrypt']);
}).then(failAndFinishJSTest, function(result) {
logError(result);
debug("\nimportKey() with null key data...");
- return crypto.subtle.importKey("raw", null, "HKDF", extractable, ['deriveKey']);
+ return crypto.subtle.importKey("raw", null, "PBKDF2", extractable, ['deriveKey']);
}).then(failAndFinishJSTest, function(result) {
logError(result);
debug("\nimportKey() with jwk format...");
- return crypto.subtle.importKey("jwk", {kty: "HKDF"}, "HKDF", extractable, ['deriveKey']);
+ return crypto.subtle.importKey("jwk", {kty: "PBKDF2"}, "PBKDF2", extractable, ['deriveKey']);
}).then(failAndFinishJSTest, function(result) {
logError(result);
debug("\nimportKey() with spki format...");
- return crypto.subtle.importKey("spki", rawBytes, "HKDF", extractable, ['deriveKey']);
+ return crypto.subtle.importKey("spki", rawBytes, "PBKDF2", extractable, ['deriveKey']);
}).then(failAndFinishJSTest, function(result) {
logError(result);
debug("\nimportKey() with empty usages...");
- return crypto.subtle.importKey("raw", rawBytes, "HKDF", extractable, []);
+ return crypto.subtle.importKey("raw", rawBytes, "PBKDF2", extractable, []);
+}).then(failAndFinishJSTest, function(result) {
+ logError(result);
+
+ debug("\nimportKey() with extractable=true ...");
+ return crypto.subtle.importKey("raw", rawBytes, "PBKDF2", true, ['deriveKey']);
}).then(failAndFinishJSTest, function(result) {
logError(result);
}).then(finishJSTest, failAndFinishJSTest);

Powered by Google App Engine
This is Rietveld 408576698