mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
add preprocessor flag to skip blocking /dev/random during libsodium init (#429)
This commit is contained in:
committed by
Frank Denis
parent
6e2b119d86
commit
94ea419247
@@ -130,7 +130,7 @@ safe_read(const int fd, void * const buf_, size_t size)
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
# if defined(__linux__) && !defined(USE_BLOCKING_RANDOM)
|
||||
# if defined(__linux__) && !defined(USE_BLOCKING_RANDOM) && !defined(NO_BLOCKING_RANDOM_POLL)
|
||||
static int
|
||||
randombytes_block_on_dev_random(void)
|
||||
{
|
||||
@@ -172,7 +172,7 @@ randombytes_salsa20_random_random_dev_open(void)
|
||||
const char ** device = devices;
|
||||
int fd;
|
||||
|
||||
# if defined(__linux__) && !defined(USE_BLOCKING_RANDOM)
|
||||
# if defined(__linux__) && !defined(USE_BLOCKING_RANDOM) && !defined(NO_BLOCKING_RANDOM_POLL)
|
||||
if (randombytes_block_on_dev_random() != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ safe_read(const int fd, void * const buf_, size_t size)
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
# if defined(__linux__) && !defined(USE_BLOCKING_RANDOM)
|
||||
# if defined(__linux__) && !defined(USE_BLOCKING_RANDOM) && !defined(NO_BLOCKING_RANDOM_POLL)
|
||||
static int
|
||||
randombytes_block_on_dev_random(void)
|
||||
{
|
||||
@@ -155,7 +155,7 @@ randombytes_sysrandom_random_dev_open(void)
|
||||
const char ** device = devices;
|
||||
int fd;
|
||||
|
||||
# if defined(__linux__) && !defined(USE_BLOCKING_RANDOM)
|
||||
# if defined(__linux__) && !defined(USE_BLOCKING_RANDOM) && !defined(NO_BLOCKING_RANDOM_POLL)
|
||||
if (randombytes_block_on_dev_random() != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user