Add support for hostname validation to a CA
This introduces a breaking change in the Netd Binder interface.
Test: Integration test added to verify failure case (but not success).
Change-Id: If40cb5dffa0cfcf5bf49241c17489b7f3dfbd037
Bug: 64753847
diff --git a/server/ResolverController.cpp b/server/ResolverController.cpp
index 823afbf..ab69383 100644
--- a/server/ResolverController.cpp
+++ b/server/ResolverController.cpp
@@ -425,6 +425,7 @@
}
int ResolverController::addPrivateDnsServer(const std::string& server, int32_t port,
+ const std::string& name,
const std::string& fingerprintAlgorithm,
const std::set<std::vector<uint8_t>>& fingerprints) {
using android::net::INetd;
@@ -453,6 +454,7 @@
}
DnsTlsTransport::Server privateServer(parsed);
privateServer.fingerprints = fingerprints;
+ privateServer.name = name;
std::lock_guard<std::mutex> guard(privateDnsLock);
// Ensure we overwrite any previous matching server. This is necessary because equality is
// based only on the IP address, not the port or fingerprints.