com php-src: Explicitly set cert verify depth if not specified: ext/openssl/openssl.c
| From: | rdlowrey@php.net | Date: | Fri, 21 Feb 2014 00:10:06 +0000 |
| Subject: | com php-src: Explicitly set cert verify depth if not specified: ext/openssl/openssl.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-76149@lists.php.net to get a copy of this message | ||
Commit: 258d04df5cd7a579259306f491a8e8b2077f5f50
Author: Daniel Lowrey <rdlowrey@php.net> Tue, 11 Feb 2014 05:39:02 -0700
Parents: 225f534b1ae30b9e843c2531d3bdd38aa8ca84f7
Branches: PHP-5.6
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=258d04df5cd7a579259306f491a8e8b2077f5f50
Log:
Explicitly set cert verify depth if not specified
Changed paths:
M ext/openssl/openssl.c
Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index ef81a85..82ac3df 100755
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -83,6 +83,7 @@
#define HAVE_EVP_PKEY_EC 1
#endif
+#define PHP_OPENSSL_DEFAULT_STREAM_VERIFY_DEPTH 9
#define PHP_OPENSSL_DEFAULT_STREAM_CIPHERS
"ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:" \
"ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:" \
"DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:"
\
@@ -1161,6 +1162,7 @@ PHP_MINIT_FUNCTION(openssl)
/* Informational stream wrapper constants */
REGISTER_STRING_CONSTANT("OPENSSL_DEFAULT_STREAM_CIPHERS",
PHP_OPENSSL_DEFAULT_STREAM_CIPHERS, CONST_CS|CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("OPENSSL_DEFAULT_STREAM_VERIFY_DEPTH",
PHP_OPENSSL_DEFAULT_STREAM_VERIFY_DEPTH, CONST_CS|CONST_PERSISTENT);
/* Ciphers */
#ifndef OPENSSL_NO_RC2
@@ -5339,6 +5341,8 @@ SSL *php_SSL_new_from_context(SSL_CTX *ctx, php_stream *stream TSRMLS_DC) /*
{{{
if (GET_VER_OPT("verify_depth")) {
convert_to_long_ex(val);
SSL_CTX_set_verify_depth(ctx, Z_LVAL_PP(val));
+ } else {
+ SSL_CTX_set_verify_depth(ctx, PHP_OPENSSL_DEFAULT_STREAM_VERIFY_DEPTH);
}
}