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

Side by Side Diff: LayoutTests/crypto/rsa-oaep-encrypt-parseAlgorithm-failures.html

Issue 289073005: [webcrypto] Hook up parameter normalization for RSA-OAEP. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 7 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
« no previous file with comments | « no previous file | LayoutTests/crypto/rsa-oaep-encrypt-parseAlgorithm-failures-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <script src="resources/keys.js"></script>
7 </head>
8 <body>
9 <p id="description"></p>
10 <div id="console"></div>
11
12 <script>
13 description("Tests bad algorithm inputs for RSA-OAEP encrypt");
14
15 jsTestIsAsync = true;
16
17 var data = new Uint8Array(16);
18
19 function importPublicKey()
20 {
21 var usages = ['encrypt'];
22 var extractable = true;
23
24 var importData = hexStringToUint8Array(kKeyData.rsa1.spki);
25 var importAlgorithm = { name: 'rsa-oaep', hash: {name: 'SHA-256'} };
26
27 return crypto.subtle.importKey('spki', importData, importAlgorithm, extracta ble, usages);
28 }
29
30 Promise.resolve(null).then(function(result) {
31 return importPublicKey();
32 }).then(function(result) {
33 publicKey = result;
34
35 shouldEvaluateAs("publicKey.algorithm.name", "RSA-OAEP");
36 shouldEvaluateAs("publicKey.algorithm.hash.name", "SHA-256");
37 shouldEvaluateAs("publicKey.type", "public");
38 shouldEvaluateAs("publicKey.extractable", true);
39 shouldEvaluateAs("publicKey.usages.join(',')", "encrypt");
40
41 return crypto.subtle.encrypt({name: "rsa-oaep", label: -1}, publicKey, data) ;
42 }).then(failAndFinishJSTest, function(result) {
43 logError(result);
44
45 return crypto.subtle.encrypt({name: "rsa-oaep", label: "foo"}, publicKey, da ta);
46 }).then(failAndFinishJSTest, function(result) {
47 logError(result);
48 }).then(finishJSTest, failAndFinishJSTest);
49
50 </script>
51
52 </body>
53 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/crypto/rsa-oaep-encrypt-parseAlgorithm-failures-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698