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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // RSASSA-PKCS1-v1_5 normalization failures (RsaKeyGenParams) | 54 // RSASSA-PKCS1-v1_5 normalization failures (RsaKeyGenParams) |
55 // --------------------------------------------------- | 55 // --------------------------------------------------- |
56 | 56 |
57 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)"); |
58 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)"); |
59 shouldThrow("crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5'}, extractable
, keyUsages)"); | 59 shouldThrow("crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5'}, extractable
, keyUsages)"); |
60 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)"); |
61 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)"); |
62 shouldThrow("crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength
: 10, publicExponent: null}, extractable , keyUsages)"); | 62 shouldThrow("crypto.subtle.generateKey({name: 'RSASSA-PKCS1-v1_5', modulusLength
: 10, publicExponent: null}, extractable , keyUsages)"); |
63 | 63 |
| 64 // --------------------------------------------------- |
| 65 // RSAES-PKCS1-v1_5 normalization failures (RsaKeyGenParams) |
| 66 // --------------------------------------------------- |
| 67 |
| 68 // Note: these are the same tests as for RSASSA-PKCS1-v1_5 above. |
| 69 |
| 70 shouldThrow("crypto.subtle.generateKey({name: 'RSAES-PKCS1-v1_5', modulusLength:
-30}, extractable , keyUsages)"); |
| 71 shouldThrow("crypto.subtle.generateKey({name: 'RSAES-PKCS1-v1_5', modulusLength:
NaN}, extractable , keyUsages)"); |
| 72 shouldThrow("crypto.subtle.generateKey({name: 'RSAES-PKCS1-v1_5'}, extractable ,
keyUsages)"); |
| 73 shouldThrow("crypto.subtle.generateKey({name: 'RSAES-PKCS1-v1_5', modulusLength:
10}, extractable , keyUsages)"); |
| 74 shouldThrow("crypto.subtle.generateKey({name: 'RSAES-PKCS1-v1_5', modulusLength:
10, publicExponent: 10}, extractable , keyUsages)"); |
| 75 shouldThrow("crypto.subtle.generateKey({name: 'RSAES-PKCS1-v1_5', modulusLength:
10, publicExponent: null}, extractable , keyUsages)"); |
| 76 |
64 // Note that fractional numbers are truncated, so this length should be | 77 // Note that fractional numbers are truncated, so this length should be |
65 // interpreted as 1024. | 78 // interpreted as 1024. |
66 crypto.subtle.generateKey({name: 'aes-cbc', length: 1024.9}, extractable, ['decr
ypt', 'encrypt']).then(function(result) { | 79 crypto.subtle.generateKey({name: 'aes-cbc', length: 1024.9}, extractable, ['decr
ypt', 'encrypt']).then(function(result) { |
67 key = result; | 80 key = result; |
68 shouldBe("key.type", "'private'") | 81 shouldBe("key.type", "'private'") |
69 shouldBe("key.extractable", "true") | 82 shouldBe("key.extractable", "true") |
70 shouldBe("key.algorithm.name", "'AES-CBC'") | 83 shouldBe("key.algorithm.name", "'AES-CBC'") |
71 shouldBe("key.algorithm.length", "1024") | 84 shouldBe("key.algorithm.length", "1024") |
72 shouldBe("key.usages.join(',')", "'encrypt,decrypt'") | 85 shouldBe("key.usages.join(',')", "'encrypt,decrypt'") |
73 | 86 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 } | 126 } |
114 shouldBe("keyPair.publicKey.foo", "'bar'"); | 127 shouldBe("keyPair.publicKey.foo", "'bar'"); |
115 | 128 |
116 }).then(finishJSTest, failAndFinishJSTest); | 129 }).then(finishJSTest, failAndFinishJSTest); |
117 | 130 |
118 </script> | 131 </script> |
119 | 132 |
120 <script src="../fast/js/resources/js-test-post.js"></script> | 133 <script src="../fast/js/resources/js-test-post.js"></script> |
121 </body> | 134 </body> |
122 </html> | 135 </html> |
OLD | NEW |