diff options
author | Leigh <leigh@php.net> | 2015-03-27 13:24:36 +0100 |
---|---|---|
committer | Leigh <leigh@php.net> | 2015-03-27 13:24:36 +0100 |
commit | 1b2d58a364b8ac5e135bec18f6b47902ec62c5db (patch) | |
tree | 5a16d8ab9335b05f6651a39975a79d070212d1f2 /ext/openssl | |
parent | bc0e5051e3b6509027c621a11332cce60dde81cb (diff) | |
download | php-git-1b2d58a364b8ac5e135bec18f6b47902ec62c5db.tar.gz |
Add RAND_egd check for compiling against LibreSSL
Diffstat (limited to 'ext/openssl')
-rw-r--r-- | ext/openssl/config0.m4 | 1 | ||||
-rw-r--r-- | ext/openssl/openssl.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/ext/openssl/config0.m4 b/ext/openssl/config0.m4 index a97114f808..bd58be3a5b 100644 --- a/ext/openssl/config0.m4 +++ b/ext/openssl/config0.m4 @@ -18,6 +18,7 @@ if test "$PHP_OPENSSL" != "no"; then AC_CHECK_LIB(ssl, DSA_get_default_method, AC_DEFINE(HAVE_DSA_DEFAULT_METHOD, 1, [OpenSSL 0.9.7 or later])) AC_CHECK_LIB(crypto, X509_free, AC_DEFINE(HAVE_DSA_DEFAULT_METHOD, 1, [OpenSSL 0.9.7 or later])) + AC_CHECK_FUNCS([RAND_egd]) PHP_SETUP_OPENSSL(OPENSSL_SHARED_LIBADD, [ diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index c64f1e92a7..9c4131f608 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -927,11 +927,13 @@ static int php_openssl_load_rand_file(const char * file, int *egdsocket, int *se if (file == NULL) { file = RAND_file_name(buffer, sizeof(buffer)); +#ifdef HAVE_RAND_EGD } else if (RAND_egd(file) > 0) { /* if the given filename is an EGD socket, don't * write anything back to it */ *egdsocket = 1; return SUCCESS; +#endif } if (file == NULL || !RAND_load_file(file, -1)) { if (RAND_status() == 0) { |