Commit:    39c0daeb71f76ce22dc604bda8a063319fd55e59
Author:    Tjerk Meesters <datib...@php.net>         Mon, 7 Oct 2013 23:04:24 
+0800
Parents:   674dd73f8c34b9faf1e777a301e5302348b48b9d
Branches:  master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=39c0daeb71f76ce22dc604bda8a063319fd55e59

Log:
Use zend_bool as return value for _match()

Changed paths:
  M  ext/openssl/openssl.c


Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 2aa850a..2b34570 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -4829,7 +4829,7 @@ static int verify_callback(int preverify_ok, 
X509_STORE_CTX *ctx) /* {{{ */
 }
 /* }}} */
 
-static int php_openssl_match_cn(const char *subjectname, const char *certname)
+static zend_bool php_openssl_match_cn(const char *subjectname, const char 
*certname)
 {
        char *wildcard;
        int prefix_len, suffix_len, subject_len;
@@ -4902,7 +4902,6 @@ int php_openssl_apply_verification_policy(SSL *ssl, X509 
*peer, php_stream *stre
        /* Does the common name match ? (used primarily for https://) */
        GET_VER_OPT_STRING("CN_match", cnmatch);
        if (cnmatch) {
-               int match = 0;
                int name_len = X509_NAME_get_text_by_NID(name, NID_commonName, 
buf, sizeof(buf));
 
                if (name_len == -1) {
@@ -4913,9 +4912,7 @@ int php_openssl_apply_verification_policy(SSL *ssl, X509 
*peer, php_stream *stre
                        return FAILURE;
                }
 
-               match = php_openssl_match_cn(cnmatch, buf);
-
-               if (!match) {
+               if (!php_openssl_match_cn(cnmatch, buf)) {
                        /* didn't match */
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Peer 
certificate CN=`%.*s' did not match expected CN=`%s'", name_len, buf, cnmatch);
                        return FAILURE;


--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to