forked from jsonn/pkgsrc
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add patches obtained from LibreSSL to fix build when RAND_EGD() or SS…
…Lv3 support is not present in SSL library. Add workaround for decimal floating point support in older versions of GCC which resolves build problem on OpenBSD. Reviewed by wiz@
- Loading branch information
sevan
committed
Nov 16, 2015
1 parent
08ed95f
commit c909848
Showing
4 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
$NetBSD: patch-ext_openssl_openssl.c,v 1.4 2015/11/16 13:12:27 sevan Exp $ | ||
|
||
Unbreak when SSL library is without RAND_EGD() support. | ||
Obtained from http://www.libressl.org/patches.html | ||
|
||
--- ext/openssl/openssl.c.orig Mon Nov 16 00:05:47 2015 | ||
+++ ext/openssl/openssl.c | ||
@@ -915,11 +915,13 @@ static int php_openssl_load_rand_file(const char * fil | ||
|
||
if (file == NULL) { | ||
file = RAND_file_name(buffer, sizeof(buffer)); | ||
+#ifdef HAVE_SSL_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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
$NetBSD: patch-ext_openssl_xp__ssl.c,v 1.1 2015/11/16 13:12:27 sevan Exp $ | ||
|
||
Unbreak when SSL library does not have SSLv3 support | ||
Obtained from http://www.libressl.org/patches.html | ||
|
||
--- ext/openssl/xp_ssl.c.orig Mon Nov 16 00:05:21 2015 | ||
+++ ext/openssl/xp_ssl.c | ||
@@ -339,9 +339,14 @@ static inline int php_openssl_setup_crypto(php_stream | ||
break; | ||
#endif | ||
case STREAM_CRYPTO_METHOD_SSLv3_CLIENT: | ||
+#ifdef OPENSSL_NO_SSL3 | ||
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv3 support is not compiled into the OpenSSL library PHP is linked against"); | ||
+ return -1; | ||
+#else | ||
sslsock->is_client = 1; | ||
method = SSLv3_client_method(); | ||
break; | ||
+#endif | ||
case STREAM_CRYPTO_METHOD_TLS_CLIENT: | ||
sslsock->is_client = 1; | ||
method = TLSv1_client_method(); | ||
@@ -351,9 +356,14 @@ static inline int php_openssl_setup_crypto(php_stream | ||
method = SSLv23_server_method(); | ||
break; | ||
case STREAM_CRYPTO_METHOD_SSLv3_SERVER: | ||
+#ifdef OPENSSL_NO_SSL3 | ||
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv3 support is not compiled into the OpenSSL library PHP is linked against"); | ||
+ return -1; | ||
+#else | ||
sslsock->is_client = 0; | ||
method = SSLv3_server_method(); | ||
break; | ||
+#endif | ||
case STREAM_CRYPTO_METHOD_SSLv2_SERVER: | ||
#ifdef OPENSSL_NO_SSL2 | ||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv2 support is not compiled into the OpenSSL library PHP is linked against"); |