summaryrefslogtreecommitdiffstats
path: root/crypto/rand
diff options
context:
space:
mode:
authorKurt Roeckx <kurt@roeckx.be>2018-06-02 17:54:29 +0200
committerKurt Roeckx <kurt@roeckx.be>2018-06-03 12:14:26 +0200
commit2545f9446e4a924548f393cc9e7391e6b10ed1b5 (patch)
tree89ac5937c6c2d24b0f91b5dbe351515879bb06a5 /crypto/rand
parentcf0891b8f1e85d130084c90661b7e05f4e90ec78 (diff)
Remove support for calling getrandom(), we now always call getentropy()
Only Linux and FreeBSD provide getrandom(), but they both also provide getentropy() since the same version and we already tried to call that. Reviewed-by: Andy Polyakov <appro@openssl.org> GH: #6405
Diffstat (limited to 'crypto/rand')
-rw-r--r--crypto/rand/rand_unix.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/crypto/rand/rand_unix.c b/crypto/rand/rand_unix.c
index 0c8e0dc488..e698dfde65 100644
--- a/crypto/rand/rand_unix.c
+++ b/crypto/rand/rand_unix.c
@@ -164,20 +164,6 @@ size_t rand_pool_acquire_entropy(RAND_POOL *pool)
# error "Seeding uses urandom but DEVRANDOM is not configured"
# endif
-# if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
-# if __GLIBC_PREREQ(2, 25)
-# define OPENSSL_HAVE_GETRANDOM
-# endif
-# endif
-
-# if (defined(__FreeBSD__) && __FreeBSD_version >= 1200061)
-# define OPENSSL_HAVE_GETRANDOM
-# endif
-
-# if defined(OPENSSL_HAVE_GETRANDOM)
-# include <sys/random.h>
-# endif
-
# if defined(OPENSSL_RAND_SEED_OS)
# if !defined(DEVRANDOM)
# error "OS seeding requires DEVRANDOM to be configured"
@@ -265,10 +251,6 @@ int syscall_random(void *buf, size_t buflen)
if (p_getentropy.p != NULL)
return p_getentropy.f(buf, buflen);
-# if defined(OPENSSL_HAVE_GETRANDOM)
- return (int)getrandom(buf, buflen, 0);
-# endif
-
/* Linux supports this since version 3.17 */
# if defined(__linux) && defined(SYS_getrandom)
return (int)syscall(SYS_getrandom, buf, buflen, 0);