summaryrefslogtreecommitdiffstats
path: root/net/base/dns_util.h
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-09 01:10:50 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-09 01:10:50 +0000
commitc36f06436af5ef0b9b63cdba15ef95a790fdcee6 (patch)
treef45cddb8f09dfc5a9a2ce2181d0a984fc085a337 /net/base/dns_util.h
parentbc2fc85e5f1c0d24e4d597837017c1dfbfe3ab22 (diff)
downloadchromium_src-c36f06436af5ef0b9b63cdba15ef95a790fdcee6.zip
chromium_src-c36f06436af5ef0b9b63cdba15ef95a790fdcee6.tar.gz
chromium_src-c36f06436af5ef0b9b63cdba15ef95a790fdcee6.tar.bz2
ForceTLS: hash hostnames, handle subdomains, canonicalise.
It turns out that JSON[Reader|Writer] cannot handle periods in key names(!). Because of this, an also to avoid leaking a sort of ForceTLS browser history in the state file, we hash the domain names. Also, this patch tries to implement the RFCs with respect to canonicalising the names. Since IDN processing has already occured by the time the name reaches us, there's only so much that we can do however. http://codereview.chromium.org/201033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25696 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/dns_util.h')
-rw-r--r--net/base/dns_util.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/net/base/dns_util.h b/net/base/dns_util.h
new file mode 100644
index 0000000..8eb98f2
--- /dev/null
+++ b/net/base/dns_util.h
@@ -0,0 +1,25 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NET_BASE_DNS_UTIL_H_
+#define NET_BASE_DNS_UTIL_H_
+
+#include <string>
+
+namespace net {
+
+// DNSDomainFromDot - convert a domain string to DNS format. From DJB's
+// public domain DNS library.
+//
+// dotted: a string in dotted form: "www.google.com"
+// out: a result in DNS form: "\x03www\x06google\x03com\x00"
+bool DNSDomainFromDot(const std::string& dotted, std::string* out);
+
+// Returns true iff the given character is in the set of valid DNS label
+// characters as given in RFC 3490, 4.1, 3(a)
+bool IsSTD3ASCIIValidCharacter(char c);
+
+} // namespace net
+
+#endif // NET_BASE_DNS_UTIL_H_