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

Side by Side Diff: LayoutTests/crypto/aes-cbc-importKey-badUsage.html

Issue 255453002: [refactor] Use a lookup table rather than binary search for algorithm normalization. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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("Importing an AES-CBC key with 'sign' usage is not allowed.");
13
14 jsTestIsAsync = true;
15
16 function importTestKey(usage)
17 {
18 var algorithm = {name: 'aes-cbc'};
19 var extractable = false;
20 var keyData = new Uint8Array(16);
21
22 // 'sign' is not applicable to AES-CBC and should be an error.
23 var usages = ["encrypt", "decrypt", "sign"];
24
25 return crypto.subtle.importKey('raw', keyData, algorithm, extractable, usage s).then(failAndFinishJSTest, function(result) {
26 debug("Failed importing AES-CBC key with usages: " + usages.join(",") + " because: ");
27 logError(result);
28 });
29 }
30
31 importTestKey().then(finishJSTest, failAndFinishJSTest);
32
33 </script>
34
35 </body>
36 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698