mirror of
https://github.com/monero-project/monero.git
synced 2024-10-01 11:49:47 -04:00
Merge pull request #819
31587bd
random: call abort(3) instead of assert in must_succeed macro (moneromooo-monero)
This commit is contained in:
commit
3d984854a6
@ -45,7 +45,7 @@ static void generate_system_random_bytes(size_t n, void *result);
|
|||||||
|
|
||||||
static void generate_system_random_bytes(size_t n, void *result) {
|
static void generate_system_random_bytes(size_t n, void *result) {
|
||||||
HCRYPTPROV prov;
|
HCRYPTPROV prov;
|
||||||
#define must_succeed(x) do if (!(x)) assert(0); while (0)
|
#define must_succeed(x) do if (!(x)) abort(); while (0)
|
||||||
must_succeed(CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT));
|
must_succeed(CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT));
|
||||||
must_succeed(CryptGenRandom(prov, (DWORD)n, result));
|
must_succeed(CryptGenRandom(prov, (DWORD)n, result));
|
||||||
must_succeed(CryptReleaseContext(prov, 0));
|
must_succeed(CryptReleaseContext(prov, 0));
|
||||||
|
Loading…
Reference in New Issue
Block a user