mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Merge 04a0676b3f into merged_master (Bitcoin PR #17563)
This commit is contained in:
commit
aec9e50be8
1 changed files with 6 additions and 0 deletions
|
|
@ -315,12 +315,16 @@ void GetOSRand(unsigned char *ent32)
|
|||
if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) {
|
||||
RandFailure();
|
||||
}
|
||||
// Silence a compiler warning about unused function.
|
||||
(void)GetDevURandom;
|
||||
#elif defined(HAVE_GETENTROPY_RAND) && defined(MAC_OSX)
|
||||
/* getentropy() is available on macOS 10.12 and later.
|
||||
*/
|
||||
if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) {
|
||||
RandFailure();
|
||||
}
|
||||
// Silence a compiler warning about unused function.
|
||||
(void)GetDevURandom;
|
||||
#elif defined(HAVE_SYSCTL_ARND)
|
||||
/* FreeBSD, NetBSD and similar. It is possible for the call to return less
|
||||
* bytes than requested, so need to read in a loop.
|
||||
|
|
@ -334,6 +338,8 @@ void GetOSRand(unsigned char *ent32)
|
|||
}
|
||||
have += len;
|
||||
} while (have < NUM_OS_RANDOM_BYTES);
|
||||
// Silence a compiler warning about unused function.
|
||||
(void)GetDevURandom;
|
||||
#else
|
||||
/* Fall back to /dev/urandom if there is no specific method implemented to
|
||||
* get system entropy for this OS.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue