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

Unified Diff: net/tools/domain_security_preload_generator/domain_security_entry.h

Issue 2551153003: Add static domain security state generator tool. (Closed)
Patch Set: Fix iOS? Created 4 years 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: net/tools/domain_security_preload_generator/domain_security_entry.h
diff --git a/net/tools/domain_security_preload_generator/domain_security_entry.h b/net/tools/domain_security_preload_generator/domain_security_entry.h
new file mode 100644
index 0000000000000000000000000000000000000000..e9d01f3cd257639980a8f3dac7a62f72980f2635
--- /dev/null
+++ b/net/tools/domain_security_preload_generator/domain_security_entry.h
@@ -0,0 +1,60 @@
+// Copyright (c) 2016 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_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_DOMAIN_SECURITY_ENTRY_H_
+#define NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_DOMAIN_SECURITY_ENTRY_H_
+
+#include <memory>
+#include <string>
+#include <vector>
+
+namespace net {
+
+namespace transport_security_state {
+
+// DomainSecurityEntry represents a preloaded entry.
+struct DomainSecurityEntry {
+ DomainSecurityEntry();
+ ~DomainSecurityEntry();
+
+ std::string hostname;
+
+ bool include_subdomains = false;
+ bool force_https = false;
+
+ bool hpkp_include_subdomains = false;
+ std::string pinset;
+
+ bool expect_ct = false;
+ std::string expect_ct_report_uri;
+
+ bool expect_staple = false;
+ bool expect_staple_include_subdomains = false;
+ std::string expect_staple_report_uri;
+};
+
+using DomainSecurityEntries = std::vector<std::unique_ptr<DomainSecurityEntry>>;
+
+// TODO(Martijnc): Remove the domain IDs from the preload format.
+// https://crbug.com/661206.
+using DomainIDList = std::vector<std::string>;
+
+// ReversedEntry points to a DomainSecurityEntry and contains the reversed
+// hostname for that entry. This is used to construct the trie.
+struct ReversedEntry {
+ ReversedEntry(std::vector<uint8_t> reversed_name,
+ const DomainSecurityEntry* entry);
+ ~ReversedEntry();
+
+ std::vector<uint8_t> reversed_name;
+ const DomainSecurityEntry* entry;
+};
+
+using ReversedEntries = std::vector<std::unique_ptr<ReversedEntry>>;
+
+} // namespace transport_security_state
+
+} // namespace net
+
+#endif // NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_DOMAIN_SECURITY_ENTRY_H_

Powered by Google App Engine
This is Rietveld 408576698