MCPcopy Create free account
hub / github.com/catboost/catboost / MatchDomainName

Function MatchDomainName

library/cpp/neh/https.cpp:272–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270 return (a.size() == b.size()) && ToString(a).to_lower() == ToString(b).to_lower();
271 }
272 bool MatchDomainName(TStringBuf tmpl, TStringBuf name) {
273 // match wildcards only in the left-most part
274 // do not support (optional according to RFC) partial wildcards (ww*.yandex.ru)
275 // see RFC-6125
276 TStringBuf tmplRest = tmpl;
277 TStringBuf tmplFirst = tmplRest.NextTok('.');
278 if (tmplFirst == "*") {
279 tmpl = tmplRest;
280 name.NextTok('.');
281 }
282 return EqualNoCase(tmpl, name);
283 }
284
285 EMatchResult MatchCertAltNames(X509* cert, TStringBuf hostname) {
286 EMatchResult result = NO_MATCH;

Callers 2

MatchCertAltNamesFunction · 0.85
MatchCertCommonNameFunction · 0.85

Calls 2

EqualNoCaseFunction · 0.85
NextTokMethod · 0.45

Tested by

no test coverage detected