diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-04-26 18:11:04 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-04-26 18:11:04 +0200 |
commit | 3d984854a69e86b1072905f4a5a90c4cef49303e (patch) | |
tree | 112b76210c0227d2a7d9b485c2c388dd2bfa05c2 | |
parent | Merge pull request #817 (diff) | |
parent | random: call abort(3) instead of assert in must_succeed macro (diff) | |
download | monero-3d984854a69e86b1072905f4a5a90c4cef49303e.tar.xz |
Merge pull request #819
31587bd random: call abort(3) instead of assert in must_succeed macro (moneromooo-monero)
-rw-r--r-- | src/crypto/random.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/crypto/random.c b/src/crypto/random.c index d7fcb7e65..f8a50d850 100644 --- a/src/crypto/random.c +++ b/src/crypto/random.c @@ -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) { 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(CryptGenRandom(prov, (DWORD)n, result)); must_succeed(CryptReleaseContext(prov, 0)); |