1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-20 02:25:14 -07:00

Do not use getrandom(2) on SLES11 service pack 4

This commit is contained in:
Frank Denis 2016-04-14 17:17:26 +02:00
parent 9a9dc02ee1
commit 531ce5bd32
2 changed files with 8 additions and 8 deletions

View File

@ -173,7 +173,7 @@ randombytes_salsa20_random_random_dev_open(void)
}
# endif
# ifdef SYS_getrandom
# if defined(SYS_getrandom) && defined(__NR_getrandom)
static int
_randombytes_linux_getrandom(void * const buf, const size_t size)
{
@ -221,7 +221,7 @@ randombytes_salsa20_random_init(void)
errno = errno_save;
# else
# ifdef SYS_getrandom
# if defined(SYS_getrandom) && defined(__NR_getrandom)
{
unsigned char fodder[16];
@ -287,7 +287,7 @@ randombytes_salsa20_random_stir(void)
# ifdef HAVE_SAFE_ARC4RANDOM
arc4random_buf(m0, sizeof m0);
# elif defined(SYS_getrandom)
# elif defined(SYS_getrandom) && defined(__NR_getrandom)
if (stream.getrandom_available != 0) {
if (randombytes_linux_getrandom(m0, sizeof m0) != 0) {
abort(); /* LCOV_EXCL_LINE */
@ -358,7 +358,7 @@ randombytes_salsa20_random_close(void)
ret = 0;
# endif
# ifdef SYS_getrandom
# if defined(SYS_getrandom) && defined(__NR_getrandom)
if (stream.getrandom_available != 0) {
ret = 0;
}

View File

@ -150,7 +150,7 @@ randombytes_sysrandom_random_dev_open(void)
/* LCOV_EXCL_STOP */
}
# ifdef SYS_getrandom
# if defined(SYS_getrandom) && defined(__NR_getrandom)
static int
_randombytes_linux_getrandom(void * const buf, const size_t size)
{
@ -191,7 +191,7 @@ randombytes_sysrandom_init(void)
{
const int errno_save = errno;
# ifdef SYS_getrandom
# if defined(SYS_getrandom) && defined(__NR_getrandom)
{
unsigned char fodder[16];
@ -248,7 +248,7 @@ randombytes_sysrandom_close(void)
stream.initialized = 0;
ret = 0;
}
# ifdef SYS_getrandom
# if defined(SYS_getrandom) && defined(__NR_getrandom)
if (stream.getrandom_available != 0) {
ret = 0;
}
@ -271,7 +271,7 @@ randombytes_sysrandom_buf(void * const buf, const size_t size)
assert(size <= ULONG_LONG_MAX);
#endif
#ifndef _WIN32
# ifdef SYS_getrandom
# if defined(SYS_getrandom) && defined(__NR_getrandom)
if (stream.getrandom_available != 0) {
if (randombytes_linux_getrandom(buf, size) != 0) {
abort();