Commit c1c2cbae authored by Adam Langley's avatar Adam Langley Committed by Commit Bot

cablev2: update tunnel server domain

The default tunnel server domain is switched to ua5v.com and, as a
protocol change, "cable." is prepended. The latter makes using a CNAME
easier because CNAMEs can't exist at a zone cut. (I.e. ua5v.com itself
cannot be a CNAME because it must have an SOA record, but cable.ua5v.com
could be a CNAME.)

BUG=1002262

Change-Id: Ia2a69ffab82f0ef065b813ffee58f16ca02bcf28
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2463808
Commit-Queue: Adam Langley <agl@chromium.org>
Reviewed-by: default avatarMartin Kreichgauer <martinkr@google.com>
Cr-Commit-Position: refs/heads/master@{#816686}
parent d161f9c7
......@@ -72,7 +72,7 @@ constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotation =
// communication. This specifies a Google service and the short domain need is
// necessary to fit within a BLE advert.
constexpr uint32_t kTunnelServer = device::cablev2::tunnelserver::EncodeDomain(
"xyi3",
"ua5v",
device::cablev2::tunnelserver::TLD::COM);
struct MakeCredRequest {
......
......@@ -93,7 +93,7 @@ namespace tunnelserver {
std::string DecodeDomain(uint32_t domain) {
static const char kBase32Chars[33] = "abcdefghijklmnopqrstuvwxyz234567";
std::string ret;
std::string ret = "cable.";
ret.push_back(kBase32Chars[(domain >> 17) & 0x1f]);
ret.push_back(kBase32Chars[(domain >> 12) & 0x1f]);
ret.push_back(kBase32Chars[(domain >> 7) & 0x1f]);
......
......@@ -22,7 +22,7 @@ TEST(CableV2Encoding, TunnelServerURLs) {
tunnelserver::EncodeDomain("abcd", tunnelserver::TLD::NET);
uint8_t tunnel_id[16] = {0};
const GURL url = tunnelserver::GetNewTunnelURL(encoded, tunnel_id);
EXPECT_TRUE(url.spec().find("//abcd.net/") != std::string::npos) << url;
EXPECT_TRUE(url.spec().find("//cable.abcd.net/") != std::string::npos) << url;
}
TEST(CableV2Encoding, EIDToFromComponents) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment