From 4b2b0cc15d51d7916a939de06a7e83d8042211dc Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 10 Jul 2017 14:32:48 +0200 Subject: Add function to generate random identifier The function is a wrapper on top of getrandom() (if available via glibc) or corresponding syscall. If neither is available than failure is always returned. It's intended to generate small random data good enough for session identifiers and keys. To generate long-term cryptographic keys it's better to use special crypto libraries (like GnuTLS for example) instead. As an example it's used to replace old insecure random number generator in osmo-auc-gen utility. Change-Id: I0241b814ea4c4ce1458f7ad76e31d390383c2048 Related: OS#1694 --- configure.ac | 3 +++ 1 file changed, 3 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 33c151e7..d9390cf8 100644 --- a/configure.ac +++ b/configure.ac @@ -73,6 +73,9 @@ AC_ARG_ENABLE(doxygen, AC_PATH_PROG(DOXYGEN,doxygen,false) AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") +# check for syscal fallback on glibc < 2.25 - can be removed once glibc version requirement is bumped +AC_CHECK_DECLS([SYS_getrandom], [], [], [[#include ]]) + # The following test is taken from WebKit's webkit.m4 saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden " -- cgit v1.2.3