]> granicus.if.org Git - php/commitdiff
Fixed bug #55618 (use case-insensitive cert name matching)
authorDaniel Lowrey <rdlowrey@php.net>
Wed, 14 Jan 2015 17:02:50 +0000 (18:02 +0100)
committerJulien Pauli <jpauli@php.net>
Wed, 21 Jan 2015 10:22:33 +0000 (11:22 +0100)
ext/openssl/openssl.c

index 4a4ec6f67d9b5f57561d6c0e1b548b6da722979a..f5ac3375df9588869d942e11645466a78fa9963d 100644 (file)
@@ -4619,14 +4619,14 @@ int php_openssl_apply_verification_policy(SSL *ssl, X509 *peer, php_stream *stre
                        return FAILURE;
                }
 
-               match = strcmp(cnmatch, buf) == 0;
+               match = strcasecmp(cnmatch, buf) == 0;
                if (!match && strlen(buf) > 3 && buf[0] == '*' && buf[1] == '.') {
                        /* Try wildcard */
 
                        if (strchr(buf+2, '.')) {
                                char *tmp = strstr(cnmatch, buf+1);
 
-                               match = tmp && strcmp(tmp, buf+2) && tmp == strchr(cnmatch, '.');
+                               match = tmp && strcasecmp(tmp, buf+2) && tmp == strchr(cnmatch, '.');
                        }
                }