mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
synced 2025-12-08 21:15:47 +00:00
fixed SF# 3325324
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// X509Certificate.cpp
|
||||
//
|
||||
// $Id: //poco/1.4/NetSSL_OpenSSL/src/X509Certificate.cpp#1 $
|
||||
// $Id: //poco/1.4/NetSSL_OpenSSL/src/X509Certificate.cpp#2 $
|
||||
//
|
||||
// Library: NetSSL_OpenSSL
|
||||
// Package: SSLCore
|
||||
@@ -167,7 +167,8 @@ bool X509Certificate::containsWildcards(const std::string& commonName)
|
||||
bool X509Certificate::matchByAlias(const std::string& alias, const HostEntry& heData)
|
||||
{
|
||||
// fix wildcards
|
||||
std::string aliasRep = Poco::replace(alias, "*", ".*");
|
||||
std::string aliasRep = Poco::replace(alias, ".", "\\.");
|
||||
Poco::replaceInPlace(aliasRep, "*", ".*");
|
||||
Poco::replaceInPlace(aliasRep, "..*", ".*");
|
||||
Poco::replaceInPlace(aliasRep, "?", ".?");
|
||||
Poco::replaceInPlace(aliasRep, "..?", ".?");
|
||||
@@ -181,6 +182,12 @@ bool X509Certificate::matchByAlias(const std::string& alias, const HostEntry& he
|
||||
{
|
||||
found = expr.match(*it);
|
||||
}
|
||||
// Handle the case where the list of aliases is empty.
|
||||
if (aliases.empty())
|
||||
{
|
||||
// Compare the host name against the wildcard host name in the certificate.
|
||||
found = expr.match(heData.name());
|
||||
}
|
||||
return found;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user