com php-src: Followup on 0ec147d3 for another place: ext/openssl/openssl.c ext/openssl/php_openssl.h ext/openssl/xp_ssl.c

From: Date: Mon, 24 Jul 2017 14:24:04 +0000
Subject: com php-src: Followup on 0ec147d3 for another place: ext/openssl/openssl.c ext/openssl/php_openssl.h ext/openssl/xp_ssl.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-98769@lists.php.net to get a copy of this message
Commit: b7eb2c060409a8f5809d6e73f53d88844cf9ed09 Author: Anatol Belski <ab@php.net> Mon, 24 Jul 2017 16:24:04 +0200 Parents: 0ec147d301b33b2cb0f347c6e81eb7e75e75b521 Branches: PHP-7.2 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b7eb2c060409a8f5809d6e73f53d88844cf9ed09 Log: Followup on 0ec147d3 for another place which requires also to move the macros into the header Changed paths: M ext/openssl/openssl.c M ext/openssl/php_openssl.h M ext/openssl/xp_ssl.c Diff: diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 148540c..19cc0ac 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -86,14 +86,6 @@ #define HAVE_EVP_PKEY_EC 1 #endif -#ifdef PHP_WIN32 -#define PHP_OPENSSL_BIO_MODE_R(flags) (((flags) & PKCS7_BINARY) ? "rb" : "r") -#define PHP_OPENSSL_BIO_MODE_W(flags) (((flags) & PKCS7_BINARY) ? "wb" : "w") -#else -#define PHP_OPENSSL_BIO_MODE_R(flags) "r" -#define PHP_OPENSSL_BIO_MODE_W(flags) "w" -#endif - ZEND_DECLARE_MODULE_GLOBALS(openssl) /* FIXME: Use the openssl constants instead of diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h index a157969..d747796 100644 --- a/ext/openssl/php_openssl.h +++ b/ext/openssl/php_openssl.h @@ -128,6 +128,15 @@ PHP_FUNCTION(openssl_spki_export); PHP_FUNCTION(openssl_spki_export_challenge); PHP_FUNCTION(openssl_get_cert_locations); + +#ifdef PHP_WIN32 +#define PHP_OPENSSL_BIO_MODE_R(flags) (((flags) & PKCS7_BINARY) ? "rb" : "r") +#define PHP_OPENSSL_BIO_MODE_W(flags) (((flags) & PKCS7_BINARY) ? "wb" : "w") +#else +#define PHP_OPENSSL_BIO_MODE_R(flags) "r" +#define PHP_OPENSSL_BIO_MODE_W(flags) "w" +#endif + #else #define phpext_openssl_ptr NULL diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 5aec089..fe7aeda 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -1181,7 +1181,7 @@ static int php_openssl_set_server_dh_param(php_stream * stream, SSL_CTX *ctx) /* } convert_to_string_ex(zdhpath); - bio = BIO_new_file(Z_STRVAL_P(zdhpath), "r"); + bio = BIO_new_file(Z_STRVAL_P(zdhpath), PHP_OPENSSL_BIO_MODE_R(PKCS7_BINARY)); if (bio == NULL) { php_error_docref(NULL, E_WARNING, "invalid dh_param");

« previous php.cvs (#98769) next »