From e1fd3903efe38880a45687299a414b1516994955 Mon Sep 17 00:00:00 2001 From: Guillaume Solignac Date: Wed, 13 Apr 2022 15:52:05 +0200 Subject: crypto-openssl: use getrandom syscall The sys/random.h header, which provides the getrandom syscall wrapper, was only added in glibc2.25. To make it compatible with older version, we can directly call the syscall. Type: improvement Signed-off-by: Guillaume Solignac Change-Id: I93c5f8a49c0323511a4e34273f0b3c0e24663bfd --- src/plugins/crypto_openssl/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/crypto_openssl/main.c b/src/plugins/crypto_openssl/main.c index 6843880eed0..c0f7ee206e1 100644 --- a/src/plugins/crypto_openssl/main.c +++ b/src/plugins/crypto_openssl/main.c @@ -15,7 +15,7 @@ *------------------------------------------------------------------ */ -#include +#include #include #include @@ -478,7 +478,7 @@ crypto_openssl_init (vlib_main_t * vm) openssl_per_thread_data_t *ptd; u8 seed[32]; - if (getrandom (&seed, sizeof (seed), 0) != sizeof (seed)) + if (syscall (SYS_getrandom, &seed, sizeof (seed), 0) != sizeof (seed)) return clib_error_return_unix (0, "getrandom() failed"); RAND_seed (seed, sizeof (seed)); -- cgit 1.2.3-korg