summaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-03-28 23:28:22 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-03-28 23:28:22 +0900
commit25ef6677e90a9628e8cbc5c0093940e0d92f695b (patch)
tree3cebc8bd4246a075d1fe6e85765a5eb4c7f30c8f /src/util.h
parentcd00b012d99e6061bbe054e08696aab00e885c42 (diff)
Added hostname check described in RFC 2818 with OpenSSL.
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h
index 243a2eeb..c0031cbc 100644
--- a/src/util.h
+++ b/src/util.h
@@ -852,6 +852,24 @@ SharedHandle<T> copy(const SharedHandle<T>& a)
// * noProxyDomainMatch("sf.net", ".sf.net") returns false.
bool noProxyDomainMatch(const std::string& hostname, const std::string& domain);
+// Checks hostname matches pattern as described in RFC 2818.
+//
+// Quoted from RFC 2818 section 3.1. Server Identity:
+//
+// Matching is performed using the matching rules specified by
+// [RFC2459]. If more than one identity of a given type is present in
+// the certificate (e.g., more than one dNSName name, a match in any
+// one of the set is considered acceptable.) Names may contain the
+// wildcard character * which is considered to match any single domain
+// name component or component fragment. E.g., *.a.com matches
+// foo.a.com but not bar.foo.a.com. f*.com matches foo.com but not
+// bar.com.
+//
+// If pattern contains multiple '*', this function considers left most
+// '*' as a wildcard character and other '*'s are considered just
+// character literals.
+bool tlsHostnameMatch(const std::string& pattern, const std::string& hostname);
+
} // namespace util
} // namespace aria2