aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2019-03-13 20:57:28 -0700
committerRichard Henderson <richard.henderson@linaro.org>2019-05-22 12:38:54 -0400
commitdb1ed1abcf4b219d9824e4a6ae5f9ae364f8d009 (patch)
tree4d755e4839eb9b71fb336f660ae11b5cda6003c6 /configure
parente9979ca64e5e4a150f5346de3982f02f54c41076 (diff)
crypto: Use getrandom for qcrypto_random_bytes
Prefer it to direct use of /dev/urandom. Reviewed-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure18
1 files changed, 17 insertions, 1 deletions
diff --git a/configure b/configure
index 54fa78c4dc..f3526a5bca 100755
--- a/configure
+++ b/configure
@@ -5816,6 +5816,20 @@ if compile_prog "" "" ; then
fi
##########################################
+# check for getrandom()
+
+have_getrandom=no
+cat > $TMPC << EOF
+#include <sys/random.h>
+int main(void) {
+ return getrandom(0, 0, GRND_NONBLOCK);
+}
+EOF
+if compile_prog "" "" ; then
+ have_getrandom=yes
+fi
+
+##########################################
# checks for sanitizers
have_asan=no
@@ -7204,7 +7218,9 @@ fi
if test "$have_utmpx" = "yes" ; then
echo "HAVE_UTMPX=y" >> $config_host_mak
fi
-
+if test "$have_getrandom" = "yes" ; then
+ echo "CONFIG_GETRANDOM=y" >> $config_host_mak
+fi
if test "$ivshmem" = "yes" ; then
echo "CONFIG_IVSHMEM=y" >> $config_host_mak
fi