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

Side by Side Diff: third_party/WebKit/LayoutTests/crypto/subtle/pbkdf2/deriveBits-failures.html

Issue 2164753002: Reject deriveBits() for PBKDF2 when given a length of 0. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 var algorithm = { 57 var algorithm = {
58 name: "PBKDF2", 58 name: "PBKDF2",
59 salt: asciiToUint8Array("salt"), 59 salt: asciiToUint8Array("salt"),
60 iterations: -10, 60 iterations: -10,
61 hash: "SHA-1" 61 hash: "SHA-1"
62 }; 62 };
63 63
64 return expectFailure( 64 return expectFailure(
65 "Deriving using iterations=-10...", 65 "Deriving using iterations=-10...",
66 crypto.subtle.deriveBits(algorithm, pbkdf2Key, 16)); 66 crypto.subtle.deriveBits(algorithm, pbkdf2Key, 16));
67 }).then(function() {
68 var algorithm = {
69 name: "PBKDF2",
70 salt: asciiToUint8Array("salt"),
71 iterations: 1024,
72 hash: "SHA-1"
73 };
74
75 return expectFailure(
76 "Deriving using length 0...",
77 crypto.subtle.deriveBits(algorithm, pbkdf2Key, 0));
78 }).then(function() {
79 var algorithm = {
80 name: "PBKDF2",
81 salt: asciiToUint8Array("salt"),
82 iterations: 1024,
83 hash: "SHA-1"
84 };
85
86 return expectFailure(
87 "Deriving using length -10...",
88 crypto.subtle.deriveBits(algorithm, pbkdf2Key, -10));
67 }).then(finishJSTest, failAndFinishJSTest); 89 }).then(finishJSTest, failAndFinishJSTest);
68 90
69 </script> 91 </script>
70 92
71 </body> 93 </body>
72 </html> 94 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698