summaryrefslogtreecommitdiff
path: root/libtac/lib/header.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtac/lib/header.c')
-rw-r--r--libtac/lib/header.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/libtac/lib/header.c b/libtac/lib/header.c
index 4852ac7..2156d2a 100644
--- a/libtac/lib/header.c
+++ b/libtac/lib/header.c
@@ -26,17 +26,7 @@
#include "config.h"
#endif
-#if defined(HAVE_OPENSSL_RAND_H) && defined(HAVE_LIBCRYPTO)
-# include <openssl/rand.h>
-#elif defined(HAVE_GETRANDOM)
-# if defined(HAVE_LINUX_RANDOM_H)
-# include <linux/random.h>
-# elif defined(HAVE_SYS_RANDOM_H)
-# include <sys/random.h>
-# endif
-#else
-# include "magic.h"
-#endif
+#include "magic.h"
/* Miscellaneous variables that are global, because we need
* store their values between different functions and connections.
@@ -88,16 +78,7 @@ HDR *_tac_req_header(u_char type, int cont_session) {
/* make session_id from pseudo-random number */
if (!cont_session) {
-#if defined(HAVE_OPENSSL_RAND_H) && defined(HAVE_LIBCRYPTO)
- // the preferred way is to use OpenSSL abstraction as we are linking it anyway for MD5
- RAND_pseudo_bytes((unsigned char *) &session_id, sizeof(session_id));
-#elif defined(HAVE_GETRANDOM)
- // experimental
- getrandom((void *) &session_id, sizeof(session_id), GRND_NONBLOCK);
-#else
- // if everything fails use the legacy code
session_id = magic();
-#endif
}
th->session_id = htonl(session_id);