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