A DWORD is the maximum CryptGenRandom() can support.

This commit is contained in:
Frank Denis 2014-04-09 19:07:41 -07:00 committed by evoskuil
parent 3ec3b66f43
commit d6e655ad97

View File

@ -169,7 +169,9 @@ randombytes_sysrandom_buf(void * const buf, const size_t size)
abort();
}
#else
// Is cast from size_t to DWORD safe here?
if (size > 0xffffffff) {
abort();
}
if (! CryptGenRandom(stream.hcrypt_prov, (DWORD) size, (BYTE *) buf)) {
abort();
}