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

Side by Side Diff: LayoutTests/crypto/aes-cbc-unwrap-failure.html

Issue 298023002: [webcrypto] Import WebKit's webcrypto tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove FIXME for unrecognized jwk usages (supported now) 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 <script src="resources/common.js"></script>
6 </head>
7 <body>
8 <p id="description"></p>
9 <div id="console"></div>
10
11 <script>
12 description("Test unwrapping an RSA key with AES-CBC.");
13
14 jsTestIsAsync = true;
15
16 var extractable = true;
17 var nonExtractable = false;
18
19 var unwrappingKeyOctets = hexStringToUint8Array("2a00e0e776e94e4dc89bf947cebdebe 1");
20 var wrappedKey = hexStringToUint8Array("b490dedb3abc3fd545e146538e6cc3ca"); // A n empty encrypted JSON.
21
22 debug("Importing an unwrapping key...");
23 crypto.subtle.importKey("raw", unwrappingKeyOctets, {name: "AES-CBC"}, nonExtrac table, ["unwrapKey"]).then(function(result) {
24 unwrappingKey = result;
25 shouldBe("unwrappingKey.algorithm.name", "'AES-CBC'");
26 var unwrapAlgorithm = {name: "AES-CBC", iv: hexStringToUint8Array("000102030 405060708090a0b0c0d0e0f")};
27 debug("Unwrapping a key...");
28 var importAlgorithm = {name: 'RSASSA-PKCS1-v1_5', hash: {name: 'sha-1'} };
29 return crypto.subtle.unwrapKey("jwk", wrappedKey, unwrappingKey, unwrapAlgor ithm, importAlgorithm, extractable, ["sign"]);
30 }).then(undefined, function(result) {
31 logError(result);
32 finishJSTest();
33 }).then(finishJSTest, failAndFinishJSTest);
34
35 </script>
36
37 </body>
38 </html>
OLDNEW
« no previous file with comments | « LayoutTests/crypto/aes-cbc-invalid-length-expected.txt ('k') | LayoutTests/crypto/aes-cbc-unwrap-failure-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698