summaryrefslogtreecommitdiff
path: root/ext/openssl/xp_ssl.c
diff options
context:
space:
mode:
authorJakub Zelenka <bukka@php.net>2018-08-19 20:19:01 +0100
committerJakub Zelenka <bukka@php.net>2018-08-19 20:19:01 +0100
commit73a8f7261720067dbec913487039ccde0fb1deb6 (patch)
tree5a6a376e53ae48ce05d64f2bf4fc96549a081467 /ext/openssl/xp_ssl.c
parentb0da1745be1370ff046da407cb3ec925aed645f5 (diff)
parent4c542e6c13ca0d1b3944efee715a4dadb4794c7c (diff)
downloadphp-git-73a8f7261720067dbec913487039ccde0fb1deb6.tar.gz
Merge branch 'PHP-7.1' into PHP-7.2
Diffstat (limited to 'ext/openssl/xp_ssl.c')
-rw-r--r--ext/openssl/xp_ssl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index e37671368e..d66a1dc088 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -481,6 +481,7 @@ static zend_bool php_openssl_matches_common_name(X509 *peer, const char *subject
static int php_openssl_apply_peer_verification_policy(SSL *ssl, X509 *peer, php_stream *stream) /* {{{ */
{
zval *val = NULL;
+ zval *peer_fingerprint;
char *peer_name = NULL;
int err,
must_verify_peer,
@@ -498,6 +499,7 @@ static int php_openssl_apply_peer_verification_policy(SSL *ssl, X509 *peer, php_
: sslsock->is_client;
must_verify_fingerprint = GET_VER_OPT("peer_fingerprint");
+ peer_fingerprint = val;
if ((must_verify_peer || must_verify_peer_name || must_verify_fingerprint) && peer == NULL) {
php_error_docref(NULL, E_WARNING, "Could not get peer certificate");
@@ -529,8 +531,8 @@ static int php_openssl_apply_peer_verification_policy(SSL *ssl, X509 *peer, php_
/* If a peer_fingerprint match is required this trumps peer and peer_name verification */
if (must_verify_fingerprint) {
- if (Z_TYPE_P(val) == IS_STRING || Z_TYPE_P(val) == IS_ARRAY) {
- if (!php_openssl_x509_fingerprint_match(peer, val)) {
+ if (Z_TYPE_P(peer_fingerprint) == IS_STRING || Z_TYPE_P(peer_fingerprint) == IS_ARRAY) {
+ if (!php_openssl_x509_fingerprint_match(peer, peer_fingerprint)) {
php_error_docref(NULL, E_WARNING,
"peer_fingerprint match failure"
);