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

Side by Side Diff: LayoutTests/crypto/resources/subtle-crypto-concurrent.js

Issue 285823002: [webcrypto] Remove RSA-ES support (1 of 3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix some usages 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
OLDNEW
1 if (self.importScripts) { 1 if (self.importScripts) {
2 importScripts('../../resources/js-test.js'); 2 importScripts('../../resources/js-test.js');
3 importScripts('common.js'); 3 importScripts('common.js');
4 } 4 }
5 5
6 function shouldEvaluateAsSilent(expressionToEval, expectedResult) 6 function shouldEvaluateAsSilent(expressionToEval, expectedResult)
7 { 7 {
8 var result = eval(expressionToEval); 8 var result = eval(expressionToEval);
9 if (result !== expectedResult) { 9 if (result !== expectedResult) {
10 testFailed(expressionToEval + " evaluated to " + result + " instead of " + expectedResult); 10 testFailed(expressionToEval + " evaluated to " + result + " instead of " + expectedResult);
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 function notifyFailure(details) 27 function notifyFailure(details)
28 { 28 {
29 doPostMessage("FAIL:" + details); 29 doPostMessage("FAIL:" + details);
30 } 30 }
31 31
32 function testGenerateRsaKey() 32 function testGenerateRsaKey()
33 { 33 {
34 var extractable = false; 34 var extractable = false;
35 var usages = ['encrypt', 'decrypt']; 35 var usages = ['sign', 'verify'];
36 // Note that the modulus length is unusually small in order to speed up 36 // Note that the modulus length is unusually small in order to speed up
37 // the test (1024 or 2048 would be more typical). 37 // the test (1024 or 2048 would be more typical).
38 var algorithm = {name: "RSAES-PKCS1-v1_5", modulusLength: 256, publicExponen t: hexStringToUint8Array("010001")}; 38 var algorithm = {name: "RSASSA-PKCS1-v1_5", modulusLength: 256, publicExpone nt: hexStringToUint8Array("010001"), hash: {name: "SHA-256"}};
39 39
40 return crypto.subtle.generateKey(algorithm, extractable, usages).then(functi on(result) { 40 return crypto.subtle.generateKey(algorithm, extractable, usages).then(functi on(result) {
41 publicKey = result.publicKey; 41 publicKey = result.publicKey;
42 privateKey = result.privateKey; 42 privateKey = result.privateKey;
43 43
44 shouldEvaluateAsSilent("publicKey.type", "public"); 44 shouldEvaluateAsSilent("publicKey.type", "public");
45 shouldEvaluateAsSilent("publicKey.extractable", true); 45 shouldEvaluateAsSilent("publicKey.extractable", true);
46 shouldEvaluateAsSilent("publicKey.algorithm.name", algorithm.name); 46 shouldEvaluateAsSilent("publicKey.algorithm.name", algorithm.name);
47 shouldEvaluateAsSilent("publicKey.algorithm.modulusLength", algorithm.mo dulusLength); 47 shouldEvaluateAsSilent("publicKey.algorithm.modulusLength", algorithm.mo dulusLength);
48 shouldEvaluateAsSilent("bytesToHexString(publicKey.algorithm.publicExpon ent)", "010001"); 48 shouldEvaluateAsSilent("bytesToHexString(publicKey.algorithm.publicExpon ent)", "010001");
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 }); 178 });
179 } 179 }
180 180
181 Promise.all([ 181 Promise.all([
182 testHmac(), 182 testHmac(),
183 testGenerateRsaKey(), 183 testGenerateRsaKey(),
184 testAesGcm(), 184 testAesGcm(),
185 testHmac(), 185 testHmac(),
186 testAesGcm(), 186 testAesGcm(),
187 ]).then(notifySuccess, notifyFailure); 187 ]).then(notifySuccess, notifyFailure);
OLDNEW
« no previous file with comments | « LayoutTests/crypto/exportKey-unextractable.html ('k') | LayoutTests/crypto/rsa-es-generateKey-parseAlgorithm-failures.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698