summaryrefslogtreecommitdiff
path: root/extra/yassl/taocrypt/include/pwdbased.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'extra/yassl/taocrypt/include/pwdbased.hpp')
-rw-r--r--extra/yassl/taocrypt/include/pwdbased.hpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/extra/yassl/taocrypt/include/pwdbased.hpp b/extra/yassl/taocrypt/include/pwdbased.hpp
index f40a336e2c3..d050fd8988b 100644
--- a/extra/yassl/taocrypt/include/pwdbased.hpp
+++ b/extra/yassl/taocrypt/include/pwdbased.hpp
@@ -48,9 +48,11 @@ word32 PBKDF2_HMAC<T>::DeriveKey(byte* derived, word32 dLen, const byte* pwd,
word32 pLen, const byte* salt, word32 sLen,
word32 iterations) const
{
- if (dLen > MaxDerivedKeyLength())
+ if (dLen > MaxDerivedKeyLength())
return 0;
+ if (iterations < 0)
+ return 0;
ByteBlock buffer(T::DIGEST_SIZE);
HMAC<T> hmac;