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 |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 data = asciiToUint8Array("hello"); | 26 data = asciiToUint8Array("hello"); |
27 hmac = {name: 'HMAC', hash: {name: 'sha-1'}}; | 27 hmac = {name: 'HMAC', hash: {name: 'sha-1'}}; |
28 | 28 |
29 importHmacKey().then(function(result) { | 29 importHmacKey().then(function(result) { |
30 key = result; | 30 key = result; |
31 | 31 |
32 // Pass invalid signature parameters to verify() | 32 // Pass invalid signature parameters to verify() |
33 return crypto.subtle.verify(hmac, key, null, data); | 33 return crypto.subtle.verify(hmac, key, null, data); |
34 }).then(failAndFinishJSTest, function(result) { | 34 }).then(failAndFinishJSTest, function(result) { |
35 error = result; | 35 logError(result); |
36 shouldBeNull("error"); | |
37 | 36 |
38 // Pass invalid signature parameters to verify() | 37 // Pass invalid signature parameters to verify() |
39 return crypto.subtle.verify(hmac, key, 'a', data); | 38 return crypto.subtle.verify(hmac, key, 'a', data); |
40 }).then(failAndFinishJSTest, function(result) { | 39 }).then(failAndFinishJSTest, function(result) { |
41 error = result; | 40 logError(result); |
42 shouldBeNull("error"); | |
43 | 41 |
44 // Pass invalid signature parameters to verify() | 42 // Pass invalid signature parameters to verify() |
45 return crypto.subtle.verify(hmac, key, [], data); | 43 return crypto.subtle.verify(hmac, key, [], data); |
46 }).then(failAndFinishJSTest, function(result) { | 44 }).then(failAndFinishJSTest, function(result) { |
47 error = result; | 45 logError(result); |
48 shouldBeNull("error"); | |
49 | 46 |
50 // Operation does not support signing. | 47 // Operation does not support signing. |
51 return crypto.subtle.sign({name: 'sha-1'}, key, data); | 48 return crypto.subtle.sign({name: 'sha-1'}, key, data); |
52 }).then(failAndFinishJSTest, function(result) { | 49 }).then(failAndFinishJSTest, function(result) { |
53 error = result; | 50 logError(result); |
54 shouldBeNull("error"); | |
55 | 51 |
56 // Operation doesn't support signing (also given an invalid key, but the | 52 // Operation doesn't support signing (also given an invalid key, but the |
57 // first failure takes priority) | 53 // first failure takes priority) |
58 return crypto.subtle.sign({name: 'RSAES-PKCS1-v1_5'}, key, data); | 54 return crypto.subtle.sign({name: 'RSAES-PKCS1-v1_5'}, key, data); |
59 }).then(failAndFinishJSTest, function(result) { | 55 }).then(failAndFinishJSTest, function(result) { |
60 error = result; | 56 logError(result); |
61 shouldBeNull("error"); | |
62 }).then(finishJSTest, failAndFinishJSTest); | 57 }).then(finishJSTest, failAndFinishJSTest); |
63 | 58 |
64 </script> | 59 </script> |
65 | 60 |
66 </body> | 61 </body> |
67 </html> | 62 </html> |
OLD | NEW |