OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <script src="../fast/js/resources/js-test-pre.js"></script> | 4 <script src="../fast/js/resources/js-test-pre.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 21 matching lines...) Expand all Loading... |
32 shouldThrow("crypto.subtle.generateKey({ name: 'aes-cbc', length: -Infinity }, e
xtractable, keyUsages)"); | 32 shouldThrow("crypto.subtle.generateKey({ name: 'aes-cbc', length: -Infinity }, e
xtractable, keyUsages)"); |
33 | 33 |
34 // --------------------------------------------------- | 34 // --------------------------------------------------- |
35 // HMAC normalization failures (HmacKeyParams) | 35 // HMAC normalization failures (HmacKeyParams) |
36 // --------------------------------------------------- | 36 // --------------------------------------------------- |
37 | 37 |
38 shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, l
ength: -3}, extractable , keyUsages)"); | 38 shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, l
ength: -3}, extractable , keyUsages)"); |
39 shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: ''}, length:
48}, extractable , keyUsages)"); | 39 shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: ''}, length:
48}, extractable , keyUsages)"); |
40 shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, l
ength: 5000000000}, extractable , keyUsages)"); | 40 shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, l
ength: 5000000000}, extractable , keyUsages)"); |
41 shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, l
ength: NaN}, extractable , keyUsages)"); | 41 shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, l
ength: NaN}, extractable , keyUsages)"); |
42 shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, l
ength: -NaN}, extractable , keyUsages)"); | |
43 shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, l
ength: Infinity}, extractable , keyUsages)"); | 42 shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, l
ength: Infinity}, extractable , keyUsages)"); |
44 shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, l
ength: -Infinity}, extractable , keyUsages)"); | 43 shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, l
ength: -Infinity}, extractable , keyUsages)"); |
| 44 shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, l
ength: crypto}, extractable , keyUsages)"); |
| 45 shouldThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}, l
ength: undefined}, extractable , keyUsages)"); |
| 46 |
| 47 // The length property doesn't strictly need to be a number according to WebIDL. |
| 48 // It just has to be convertable with ToNumber(). |
| 49 shouldNotThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}
, length: '48'}, extractable , keyUsages)"); |
| 50 shouldNotThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}
, length: null}, extractable , keyUsages)"); |
| 51 shouldNotThrow("crypto.subtle.generateKey({name: 'hmac', hash: {name: 'sha-256'}
, length: true}, extractable , keyUsages)"); |
45 | 52 |
46 // --------------------------------------------------- | 53 // --------------------------------------------------- |
47 // RSASSA-PKCS1-v1_5 normalization failures (RsaKeyGenParams) | 54 // RSASSA-PKCS1-v1_5 normalization failures (RsaKeyGenParams) |
48 // --------------------------------------------------- | 55 // --------------------------------------------------- |
49 | 56 |
50 shouldThrow("crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength
: -30}, extractable , keyUsages)"); | 57 shouldThrow("crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength
: -30}, extractable , keyUsages)"); |
51 shouldThrow("crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength
: NaN}, extractable , keyUsages)"); | 58 shouldThrow("crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength
: NaN}, extractable , keyUsages)"); |
52 shouldThrow("crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5'}, extractable
, keyUsages)"); | 59 shouldThrow("crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5'}, extractable
, keyUsages)"); |
53 shouldThrow("crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength
: 10}, extractable , keyUsages)"); | 60 shouldThrow("crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength
: 10}, extractable , keyUsages)"); |
54 shouldThrow("crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength
: 10, publicExponent: 10}, extractable , keyUsages)"); | 61 shouldThrow("crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength
: 10, publicExponent: 10}, extractable , keyUsages)"); |
(...skipping 28 matching lines...) Expand all Loading... |
83 shouldBe("key.algorithm.hash.name", "'SHA-256'") | 90 shouldBe("key.algorithm.hash.name", "'SHA-256'") |
84 shouldBe("key.algorithm.length", "48") | 91 shouldBe("key.algorithm.length", "48") |
85 shouldBe("key.usages.join(',')", "'sign'") | 92 shouldBe("key.usages.join(',')", "'sign'") |
86 }).then(finishJSTest, failAndFinishJSTest); | 93 }).then(finishJSTest, failAndFinishJSTest); |
87 | 94 |
88 </script> | 95 </script> |
89 | 96 |
90 <script src="../fast/js/resources/js-test-post.js"></script> | 97 <script src="../fast/js/resources/js-test-post.js"></script> |
91 </body> | 98 </body> |
92 </html> | 99 </html> |
OLD | NEW |