Fixed hostname matching for OpenSSL (thanks to ElmüSoft).

This commit is contained in:
Vincent Richard 2014-08-19 08:17:59 +02:00
parent f3c9002af5
commit 674c3697f9

View File

@ -416,10 +416,10 @@ bool X509Certificate_OpenSSL::verifyHostName
CONF_VALUE* cnf = sk_CONF_VALUE_value(val, j); CONF_VALUE* cnf = sk_CONF_VALUE_value(val, j);
if ((strcasecmp(cnf->name, "DNS") == 0 && if ((strcasecmp(cnf->name, "DNS") == 0 &&
strcasecmp(cnf->value, hostname.c_str()) == 0) cnMatch(cnf->value, hostname.c_str()))
|| ||
(strncasecmp(cnf->name, "IP", 2) == 0 && (strncasecmp(cnf->name, "IP", 2) == 0 &&
strcasecmp(cnf->value, hostname.c_str()) == 0)) cnMatch(cnf->value, hostname.c_str())))
{ {
return true; return true;
} }