Fix divide by 0 finding (GH #855)
I'm not sure which tool is producing this finding. I am pretty sure it is a false positive, but clear it for the sake of dark and silent cockpitspull/857/head
parent
26a59cd94b
commit
18d5e5528f
|
|
@ -245,7 +245,11 @@ size_t PKCS5_PBKDF2_HMAC<T>::DeriveKey(byte *derived, size_t derivedLen, byte pu
|
|||
// Business logic
|
||||
if (!iterations) { iterations = 1; }
|
||||
|
||||
// DigestSize check due to https://github.com/weidai11/cryptopp/issues/855
|
||||
HMAC<T> hmac(secret, secretLen);
|
||||
if (hmac.DigestSize() == 0)
|
||||
throw InvalidArgument("PKCS5_PBKDF2_HMAC: DigestSize cannot be 0");
|
||||
|
||||
SecByteBlock buffer(hmac.DigestSize());
|
||||
ThreadUserTimer timer;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue