OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_TOOLS_TRANSPORT_SECURITY_STATE_GENERATOR_PRELOADED_STATE_GENERATOR_H
_ | 5 #ifndef NET_TOOLS_TRANSPORT_SECURITY_STATE_GENERATOR_PRELOADED_STATE_GENERATOR_H
_ |
6 #define NET_TOOLS_TRANSPORT_SECURITY_STATE_GENERATOR_PRELOADED_STATE_GENERATOR_H
_ | 6 #define NET_TOOLS_TRANSPORT_SECURITY_STATE_GENERATOR_PRELOADED_STATE_GENERATOR_H
_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 // PreloadedStateGenerator generates C++ code that contains the preloaded | 22 // PreloadedStateGenerator generates C++ code that contains the preloaded |
23 // entries in a way the Chromium code understands. The code that reads the | 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 | 24 // output can be found in net/http/transport_security_state.cc. The output gets |
25 // compiled into the binary. | 25 // compiled into the binary. |
26 class PreloadedStateGenerator { | 26 class PreloadedStateGenerator { |
27 public: | 27 public: |
28 PreloadedStateGenerator(); | 28 PreloadedStateGenerator(); |
29 ~PreloadedStateGenerator(); | 29 ~PreloadedStateGenerator(); |
30 | 30 |
31 std::string Generate(const std::string& preload_template, | 31 bool Generate(const std::string& preload_template, |
32 const TransportSecurityStateEntries& entries, | 32 const TransportSecurityStateEntries& entries, |
33 const DomainIDList& domain_ids, | 33 const DomainIDList& domain_ids, |
34 const Pinsets& pinsets, | 34 const Pinsets& pinsets, |
35 bool verbose); | 35 std::string* output); |
36 | 36 |
37 private: | 37 private: |
38 // TODO(Martijnc): Remove the domain IDs from the preload format. | 38 // TODO(Martijnc): Remove the domain IDs from the preload format. |
39 // https://crbug.com/661206. | 39 // https://crbug.com/661206. |
40 void ProcessDomainIds(const DomainIDList& domain_ids, | 40 void ProcessDomainIds(const DomainIDList& domain_ids, |
41 NameIDMap* map, | 41 NameIDMap* map, |
42 std::string* tpl); | 42 std::string* tpl); |
43 void ProcessSPKIHashes(const Pinsets& pinset, std::string* tpl); | 43 void ProcessSPKIHashes(const Pinsets& pinset, std::string* tpl); |
44 void ProcessExpectCTURIs(const TransportSecurityStateEntries& entries, | 44 void ProcessExpectCTURIs(const TransportSecurityStateEntries& entries, |
45 NameIDMap* expect_ct_report_uri_map, | 45 NameIDMap* expect_ct_report_uri_map, |
46 std::string* tpl); | 46 std::string* tpl); |
47 void ProcessExpectStapleURIs(const TransportSecurityStateEntries& entries, | 47 void ProcessExpectStapleURIs(const TransportSecurityStateEntries& entries, |
48 NameIDMap* expect_staple_report_uri_map, | 48 NameIDMap* expect_staple_report_uri_map, |
49 std::string* tpl); | 49 std::string* tpl); |
50 void ProcessPinsets(const Pinsets& pinset, | 50 void ProcessPinsets(const Pinsets& pinset, |
51 NameIDMap* pinset_map, | 51 NameIDMap* pinset_map, |
52 std::string* tpl); | 52 std::string* tpl); |
53 }; | 53 }; |
54 | 54 |
55 } // namespace transport_security_state | 55 } // namespace transport_security_state |
56 | 56 |
57 } // namespace net | 57 } // namespace net |
58 | 58 |
59 #endif // NET_TOOLS_TRANSPORT_SECURITY_STATE_GENERATOR_PRELOADED_STATE_GENERATO
R_H_ | 59 #endif // NET_TOOLS_TRANSPORT_SECURITY_STATE_GENERATOR_PRELOADED_STATE_GENERATO
R_H_ |
OLD | NEW |