OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
5 <script src="resources/common.js"></script> | 5 <script src="resources/common.js"></script> |
6 </head> | 6 </head> |
7 <body> | 7 <body> |
8 <p id="description"></p> | 8 <p id="description"></p> |
9 <div id="console"></div> | 9 <div id="console"></div> |
10 | 10 |
11 <script> | 11 <script> |
12 description("Tests generateKey() with bad RSASSA-PKCS1-v1_5 parameters."); | 12 description("Tests generateKey() with bad RSASSA-PKCS1-v1_5 parameters."); |
13 jsTestIsAsync = true; | 13 jsTestIsAsync = true; |
14 | 14 |
15 extractable = true; | 15 extractable = true; |
16 keyUsages = ['sign', 'verify']; | 16 keyUsages = ['sign', 'verify']; |
17 | 17 |
18 Promise.resolve(null).then(function() { | 18 Promise.resolve(null).then(function() { |
19 return crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength:
-30}, extractable , keyUsages); | 19 return crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength:
-30}, extractable , keyUsages); |
20 }).then(failAndFinishJSTest, function(result) { | 20 }).then(failAndFinishJSTest, function(result) { |
21 error = result; | 21 logError(result); |
22 shouldBeNull("error"); | |
23 | 22 |
24 return crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength:
NaN}, extractable , keyUsages); | 23 return crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength:
NaN}, extractable , keyUsages); |
25 }).then(failAndFinishJSTest, function(result) { | 24 }).then(failAndFinishJSTest, function(result) { |
26 error = result; | 25 logError(result); |
27 shouldBeNull("error"); | |
28 | 26 |
29 return crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5'}, extractable ,
keyUsages); | 27 return crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5'}, extractable ,
keyUsages); |
30 }).then(failAndFinishJSTest, function(result) { | 28 }).then(failAndFinishJSTest, function(result) { |
31 error = result; | 29 logError(result); |
32 shouldBeNull("error"); | |
33 | 30 |
34 return crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength:
10}, extractable , keyUsages); | 31 return crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength:
10}, extractable , keyUsages); |
35 }).then(failAndFinishJSTest, function(result) { | 32 }).then(failAndFinishJSTest, function(result) { |
36 error = result; | 33 logError(result); |
37 shouldBeNull("error"); | |
38 | 34 |
39 return crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength:
10, publicExponent: 10}, extractable , keyUsages); | 35 return crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength:
10, publicExponent: 10}, extractable , keyUsages); |
40 }).then(failAndFinishJSTest, function(result) { | 36 }).then(failAndFinishJSTest, function(result) { |
41 error = result; | 37 logError(result); |
42 shouldBeNull("error"); | |
43 | 38 |
44 return crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength:
10, publicExponent: null}, extractable , keyUsages); | 39 return crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength:
10, publicExponent: null}, extractable , keyUsages); |
45 }).then(failAndFinishJSTest, function(result) { | 40 }).then(failAndFinishJSTest, function(result) { |
46 error = result; | 41 logError(result); |
47 shouldBeNull("error"); | |
48 }).then(finishJSTest, failAndFinishJSTest); | 42 }).then(finishJSTest, failAndFinishJSTest); |
49 | 43 |
50 </script> | 44 </script> |
51 | 45 |
52 </body> | 46 </body> |
53 </html> | 47 </html> |
OLD | NEW |