diff options
author | Jakub Zelenka <bukka@php.net> | 2018-08-19 20:19:48 +0100 |
---|---|---|
committer | Jakub Zelenka <bukka@php.net> | 2018-08-19 20:19:48 +0100 |
commit | 52ea129efb7b49aaa5c49c43d886602ee0a8d878 (patch) | |
tree | 3f431730612f1cc01c7672a9d6e2cdaea8310641 /ext/openssl/xp_ssl.c | |
parent | 97080837790cc67af5b75299a00eb1749b9bd76e (diff) | |
parent | 73a8f7261720067dbec913487039ccde0fb1deb6 (diff) | |
download | php-git-52ea129efb7b49aaa5c49c43d886602ee0a8d878.tar.gz |
Merge branch 'PHP-7.2' into PHP-7.3
Diffstat (limited to 'ext/openssl/xp_ssl.c')
-rw-r--r-- | ext/openssl/xp_ssl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index b26fc26544..11bea41295 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -485,6 +485,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, @@ -502,6 +503,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"); @@ -533,8 +535,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" ); |