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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/crypto/subtle/pbkdf2/deriveBits-failures.html
diff --git a/third_party/WebKit/LayoutTests/crypto/subtle/pbkdf2/deriveBits-failures.html b/third_party/WebKit/LayoutTests/crypto/subtle/pbkdf2/deriveBits-failures.html
index 71052f4926cd0f6945d3c36708d7cfcf24b17128..cbe06f122bda39211b7c80c4f088c0e8bd24e720 100644
--- a/third_party/WebKit/LayoutTests/crypto/subtle/pbkdf2/deriveBits-failures.html
+++ b/third_party/WebKit/LayoutTests/crypto/subtle/pbkdf2/deriveBits-failures.html
@@ -64,6 +64,28 @@ importPbkdf2Key().then(function() {
return expectFailure(
"Deriving using iterations=-10...",
crypto.subtle.deriveBits(algorithm, pbkdf2Key, 16));
+}).then(function() {
+ var algorithm = {
+ name: "PBKDF2",
+ salt: asciiToUint8Array("salt"),
+ iterations: 1024,
+ hash: "SHA-1"
+ };
+
+ return expectFailure(
+ "Deriving using length 0...",
+ crypto.subtle.deriveBits(algorithm, pbkdf2Key, 0));
+}).then(function() {
+ var algorithm = {
+ name: "PBKDF2",
+ salt: asciiToUint8Array("salt"),
+ iterations: 1024,
+ hash: "SHA-1"
+ };
+
+ return expectFailure(
+ "Deriving using length -10...",
+ crypto.subtle.deriveBits(algorithm, pbkdf2Key, -10));
}).then(finishJSTest, failAndFinishJSTest);
</script>

Powered by Google App Engine
This is Rietveld 408576698