Skip to content

Commit

Permalink
openssl: Detect the availability of RAND_egd (tiny change)
Browse files Browse the repository at this point in the history
Alternatives like LibreSSL don't provide RAND_egd() anymore.
Fixes compilation on OpenBSD.
  • Loading branch information
jcourreges authored and rockdaboot committed Dec 17, 2014
1 parent b8c567a commit b577869
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ AS_IF([test x"$with_ssl" = xopenssl], [
AC_MSG_NOTICE([compiling in support for SSL via OpenSSL])
AC_LIBOBJ([openssl])
LIBS="$LIBSSL $LIBS"
AC_CHECK_FUNCS([RAND_egd])
elif test x"$with_ssl" != x
then
AC_MSG_ERROR([--with-ssl=openssl was given, but SSL is not available.])
Expand Down
2 changes: 2 additions & 0 deletions src/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ init_prng (void)
if (RAND_status ())
return;

#ifdef HAVE_RAND_EGD
/* Get random data from EGD if opt.egd_file was used. */
if (opt.egd_file && *opt.egd_file)
RAND_egd (opt.egd_file);
#endif

if (RAND_status ())
return;
Expand Down

0 comments on commit b577869

Please sign in to comment.