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

Side by Side Diff: net/tools/domain_security_preload_generator/preloaded_state_generator.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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_PRELOADED_STATE_GENERATOR_H_
6 #define NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_PRELOADED_STATE_GENERATOR_H_
7
8 #include <stdint.h>
9
10 #include <memory>
11 #include <string>
12
13 #include "net/tools/domain_security_preload_generator/domain_security_entry.h"
14 #include "net/tools/domain_security_preload_generator/pinset.h"
15 #include "net/tools/domain_security_preload_generator/pinsets.h"
16 #include "net/tools/domain_security_preload_generator/trie/trie_writer.h"
17
18 namespace net {
19
20 namespace transport_security_state {
21
22 // PreloadedStateGenerator generates C++ code that contains the preloaded
23 // entries in a way the Chromium code understands. The code that reads the
24 // output can be found in net/http/transport_security_state.cc. The output gets
25 // compiled into the binary.
26 class PreloadedStateGenerator {
27 public:
28 PreloadedStateGenerator();
29 ~PreloadedStateGenerator();
30
31 std::string Generate(const std::string& preload_template,
32 const DomainSecurityEntries& entries,
33 const DomainIDList& domain_ids,
34 const Pinsets& pinsets,
35 bool verbose);
36
37 private:
38 // TODO(Martijnc): Remove the domain IDs from the preload format.
39 // https://crbug.com/661206.
40 void ProcessDomainIds(const DomainIDList& domain_ids,
41 NameIDMap* map,
42 std::string* tpl);
43 void ProcessSPKIHashes(const Pinsets& pinset, std::string* tpl);
44 void ProcessExpectCTURIs(const DomainSecurityEntries& entries,
45 NameIDMap* expect_ct_report_uri_map,
46 std::string* tpl);
47 void ProcessExpectStapleURIs(const DomainSecurityEntries& entries,
48 NameIDMap* expect_staple_report_uri_map,
49 std::string* tpl);
50 void ProcessPinsets(const Pinsets& pinset,
51 NameIDMap* pinset_map,
52 std::string* tpl);
53 };
54
55 } // namespace transport_security_state
56
57 } // namespace net
58
59 #endif // NET_TOOLS_DOMAIN_SECURITY_PRELOAD_GENERATOR_PRELOADED_STATE_GENERATOR _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698