mirror of
https://github.com/open-quantum-safe/liboqs.git
synced 2025-10-06 00:03:35 -04:00
Fixed Windows Crypto API rand call on uninitialized machines. (#10)
* Modified CAPI call to avoid error when no key container is present for the user.
This commit is contained in:
parent
5521fe8c8d
commit
8b7139a20b
@ -65,8 +65,8 @@ static OQS_RAND_urandom_chacha20_ctx *OQS_RAND_urandom_chacha20_ctx_new() {
|
||||
goto err;
|
||||
}
|
||||
#if defined(WINDOWS)
|
||||
if (!CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, 0) ||
|
||||
!CryptGenRandom(hCryptProv, 32, rand_ctx->key)) {
|
||||
if (!CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT) ||
|
||||
!CryptGenRandom(hCryptProv, 32, rand_ctx->key)) {
|
||||
goto err;
|
||||
}
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user