com php-src: Wildcards should only be used in the first name component; fixed comment style: ext/openssl/xp_ssl.c

From: Date: Tue, 29 Jul 2014 11:15:01 +0000
Subject: com php-src: Wildcards should only be used in the first name component; fixed comment style: ext/openssl/xp_ssl.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-79610@lists.php.net to get a copy of this message
Commit: a7dad26c4bf80b65c1abd51e1695b3895add27f5 Author: Tjerk Meesters <datibbaw@php.net> Tue, 29 Jul 2014 19:15:01 +0800 Parents: 9720d92c671f31c80bec57d8ed864b8ac5efa914 Branches: PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a7dad26c4bf80b65c1abd51e1695b3895add27f5 Log: Wildcards should only be used in the first name component; fixed comment style Changed paths: M ext/openssl/xp_ssl.c Diff: diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index 03a84bf..ba35c88 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -274,11 +274,12 @@ static zend_bool matches_wildcard_name(const char *subjectname, const char *cert return 1; } - if (!(wildcard = strchr(certname, '*'))) { + /* wildcard, if present, must only be present in the left-most component */ + if (!(wildcard = strchr(certname, '*')) || memchr(certname, '.', wildcard - certname)) { return 0; } - // 1) prefix, if not empty, must match subject + /* 1) prefix, if not empty, must match subject */ prefix_len = wildcard - certname; if (prefix_len && strncasecmp(subjectname, certname, prefix_len) != 0) { return 0;

« previous php.cvs (#79610) next »