From 0cea0c17d292cad72a6b7a01f187c7a2af065198 Mon Sep 17 00:00:00 2001 From: Hamcha Date: Sun, 3 Aug 2014 12:30:51 +0200 Subject: [PATCH] Allow compilation for targets without EGD (ie LibreSSL) --- libratbox/src/openssl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libratbox/src/openssl.c b/libratbox/src/openssl.c index 1606826..1ed5ee6 100644 --- a/libratbox/src/openssl.c +++ b/libratbox/src/openssl.c @@ -563,6 +563,11 @@ rb_ssl_start_connected(rb_fde_t *F, CNCB * callback, void *data, int timeout) int rb_init_prng(const char *path, prng_seed_t seed_type) { +#ifndef HAVE_SSL_RAND_EGD + /* We may not have EGD (old OpenSSL / LibreSSL), fall back to default */ + seed_type = RB_PRNG_DEFAULT; +#endif + if(seed_type == RB_PRNG_DEFAULT) { #ifdef _WIN32 @@ -575,10 +580,12 @@ rb_init_prng(const char *path, prng_seed_t seed_type) switch (seed_type) { +#ifdef HAVE_SSL_RAND_EGD case RB_PRNG_EGD: if(RAND_egd(path) == -1) return -1; break; +#endif case RB_PRNG_FILE: if(RAND_load_file(path, -1) == -1) return -1;