Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Unified Diff: components/certificate_transparency/mock_log_dns_traffic.h

Issue 2375693002: LogDnsClient now rejects responses unless they contain exactly one TXT RDATA string (Closed)
Patch Set: Use checked_cast Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/certificate_transparency/mock_log_dns_traffic.h
diff --git a/components/certificate_transparency/mock_log_dns_traffic.h b/components/certificate_transparency/mock_log_dns_traffic.h
index f91e66824de64b4a0b1d63914ca54da1977eb80a..2496737f864b06ea5ab91dac9d5c992d36cf1a04 100644
--- a/components/certificate_transparency/mock_log_dns_traffic.h
+++ b/components/certificate_transparency/mock_log_dns_traffic.h
@@ -92,15 +92,20 @@ class MockLogDnsTraffic {
// Expect a CT DNS request for the domain |qname|.
// Such a request will timeout.
// This will reduce the DNS timeout to minimize test duration.
void ExpectRequestAndTimeout(base::StringPiece qname);
// Expect a CT DNS request for the domain |qname|.
+ // Such a request will receive a DNS TXT response containing |txt_strings|.
+ void ExpectRequestAndResponse(
+ base::StringPiece qname,
+ const std::vector<base::StringPiece>& txt_strings);
+ // Expect a CT DNS request for the domain |qname|.
// Such a request will receive a DNS response containing |leaf_index|.
// A description of such a request and response can be seen here:
// https://github.com/google/certificate-transparency-rfcs/blob/c8844de6bd0b5d3d16bac79865e6edef533d760b/dns/draft-ct-over-dns.md#hash-query-hashquery
void ExpectLeafIndexRequestAndResponse(base::StringPiece qname,
- base::StringPiece leaf_index);
+ uint64_t leaf_index);
// Expect a CT DNS request for the domain |qname|.
// Such a request will receive a DNS response containing the inclusion proof
// nodes between |audit_path_start| and |audit_path_end|.
// A description of such a request and response can be seen here:
// https://github.com/google/certificate-transparency-rfcs/blob/c8844de6bd0b5d3d16bac79865e6edef533d760b/dns/draft-ct-over-dns.md#tree-query-treequery
@@ -129,15 +134,10 @@ class MockLogDnsTraffic {
void SetSocketReadMode(net::IoMode read_mode) {
socket_read_mode_ = read_mode;
}
private:
- // Expect A CT DNS request for the domain |qname|.
- // Such a request will receive a DNS response containing |answer|.
- void ExpectRequestAndResponse(base::StringPiece qname,
- base::StringPiece answer);
-
// Constructs MockSocketData from |args| and adds it to |socket_factory_|.
template <typename... Args>
void EmplaceMockSocketData(Args&&... args);
// Sets the timeout used for DNS queries.

Powered by Google App Engine
This is Rietveld 408576698