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

Unified Diff: LayoutTests/crypto/hmac-export-key.html

Issue 336173002: [webcrypto] Require importKey() for JWK to provide data as a Javascript object rather than a JSON a… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update additional tests 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
« no previous file with comments | « LayoutTests/crypto/aes-export-key.html ('k') | LayoutTests/crypto/hmac-import-jwk.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/crypto/hmac-export-key.html
diff --git a/LayoutTests/crypto/hmac-export-key.html b/LayoutTests/crypto/hmac-export-key.html
index 7b7097d2a9a1cef6d362e9cda38633aaa55fcbdb..36a94a16cceddf9941d1a2a86e69273f0bf429dc 100644
--- a/LayoutTests/crypto/hmac-export-key.html
+++ b/LayoutTests/crypto/hmac-export-key.html
@@ -21,10 +21,8 @@ var jwkKey = {
"k": "ahjkn-_387fgnsibf23qsvahjkn-_387fgnsibf23qs"
};
-var jwkKeyAsArrayBuffer = asciiToUint8Array(JSON.stringify(jwkKey));
-
debug("Importing a JWK key...");
-crypto.subtle.importKey("jwk", jwkKeyAsArrayBuffer, { name: "HMAC", hash: {name: "SHA-256"} }, extractable, ["sign", "verify"]).then(function(result) {
+crypto.subtle.importKey("jwk", jwkKey, { name: "HMAC", hash: {name: "SHA-256"} }, extractable, ["sign", "verify"]).then(function(result) {
key = result;
return crypto.subtle.exportKey(null, key);
@@ -61,7 +59,7 @@ crypto.subtle.importKey("jwk", jwkKeyAsArrayBuffer, { name: "HMAC", hash: {name:
shouldBe("exportedJWK.key_ops", "['sign', 'verify']");
debug("\nImporting a key that's not extractable...");
- return crypto.subtle.importKey("jwk", jwkKeyAsArrayBuffer, { name: "HMAC", hash: {name: "SHA-256"} }, nonExtractable, ["sign", "verify"]);
+ return crypto.subtle.importKey("jwk", jwkKey, { name: "HMAC", hash: {name: "SHA-256"} }, nonExtractable, ["sign", "verify"]);
}, failAndFinishJSTest).then(function(result) {
key = result;
« no previous file with comments | « LayoutTests/crypto/aes-export-key.html ('k') | LayoutTests/crypto/hmac-import-jwk.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698