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

Side by Side Diff: LayoutTests/crypto/generateKey.html

Issue 23441021: WebCrypto: Add algorithm normalization rules for RSAES-PKCS1-v1_5. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
« no previous file with comments | « no previous file | LayoutTests/crypto/generateKey-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/crypto/generateKey-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698