Reject deriveBits() for PBKDF2 when given a length of 0.
BUG=534964
Review-Url: https://codereview.chromium.org/2164753002
Cr-Commit-Position: refs/heads/master@{#406393}
diff --git a/components/webcrypto/status.cc b/components/webcrypto/status.cc
index 4747a7f0..f0d25ff4 100644
--- a/components/webcrypto/status.cc
+++ b/components/webcrypto/status.cc
@@ -351,6 +351,12 @@
"No length was specified for the PBKDF2 Derive Bits operation.");
}
+Status Status::ErrorPbkdf2DeriveBitsLengthZero() {
+ return Status(
+ blink::WebCryptoErrorTypeOperation,
+ "A length of 0 was specified for PBKDF2's Derive Bits operation.");
+}
+
Status Status::ErrorPbkdf2Iterations0() {
return Status(blink::WebCryptoErrorTypeOperation,
"PBKDF2 requires iterations > 0");