OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_HTTP_TRANSPORT_SECURITY_STATE_H_ | 5 #ifndef NET_HTTP_TRANSPORT_SECURITY_STATE_H_ |
6 #define NET_HTTP_TRANSPORT_SECURITY_STATE_H_ | 6 #define NET_HTTP_TRANSPORT_SECURITY_STATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/strings/string_piece.h" | 16 #include "base/strings/string_piece.h" |
17 #include "base/threading/non_thread_safe.h" | 17 #include "base/threading/non_thread_safe.h" |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "net/base/expiring_cache.h" | 19 #include "net/base/expiring_cache.h" |
20 #include "net/base/hash_value.h" | 20 #include "net/base/hash_value.h" |
21 #include "net/base/net_export.h" | 21 #include "net/base/net_export.h" |
| 22 #include "net/http/transport_security_state_structs.h" |
22 #include "url/gurl.h" | 23 #include "url/gurl.h" |
23 | 24 |
24 namespace net { | 25 namespace net { |
25 | 26 |
26 class HostPortPair; | 27 class HostPortPair; |
27 class SSLInfo; | 28 class SSLInfo; |
28 class X509Certificate; | 29 class X509Certificate; |
29 | 30 |
| 31 // Sets the transport security state data source. |
| 32 void NET_EXPORT_PRIVATE |
| 33 SetTransportSecurityStateSource(const uint8_t* hsts_huffman_tree, |
| 34 const size_t hsts_huffman_tree_size, |
| 35 const uint8_t* preloaded_hsts_data, |
| 36 const size_t preloaded_hsts_bits, |
| 37 const size_t hsts_root_position, |
| 38 const char* const* expect_ct_report_uris, |
| 39 const char* const* expect_staple_report_uris, |
| 40 const struct Pinset hsts_pinsets[], |
| 41 const size_t hsts_pinsets_count); |
| 42 |
| 43 // Sets the transport security state data source back to the default source |
| 44 // (transport_security_state_static.h). |
| 45 void NET_EXPORT_PRIVATE SetDefaultTransportSecurityStateSource(); |
| 46 |
30 // Tracks which hosts have enabled strict transport security and/or public | 47 // Tracks which hosts have enabled strict transport security and/or public |
31 // key pins. | 48 // key pins. |
32 // | 49 // |
33 // This object manages the in-memory store. Register a Delegate with | 50 // This object manages the in-memory store. Register a Delegate with |
34 // |SetDelegate| to persist the state to disk. | 51 // |SetDelegate| to persist the state to disk. |
35 // | 52 // |
36 // HTTP strict transport security (HSTS) is defined in | 53 // HTTP strict transport security (HSTS) is defined in |
37 // http://tools.ietf.org/html/ietf-websec-strict-transport-sec, and | 54 // http://tools.ietf.org/html/ietf-websec-strict-transport-sec, and |
38 // HTTP-based dynamic public key pinning (HPKP) is defined in | 55 // HTTP-based dynamic public key pinning (HPKP) is defined in |
39 // http://tools.ietf.org/html/ietf-websec-key-pinning. | 56 // http://tools.ietf.org/html/ietf-websec-key-pinning. |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 // rate-limiting. | 615 // rate-limiting. |
599 ExpiringCache<std::string, bool, base::TimeTicks, std::less<base::TimeTicks>> | 616 ExpiringCache<std::string, bool, base::TimeTicks, std::less<base::TimeTicks>> |
600 sent_reports_cache_; | 617 sent_reports_cache_; |
601 | 618 |
602 DISALLOW_COPY_AND_ASSIGN(TransportSecurityState); | 619 DISALLOW_COPY_AND_ASSIGN(TransportSecurityState); |
603 }; | 620 }; |
604 | 621 |
605 } // namespace net | 622 } // namespace net |
606 | 623 |
607 #endif // NET_HTTP_TRANSPORT_SECURITY_STATE_H_ | 624 #endif // NET_HTTP_TRANSPORT_SECURITY_STATE_H_ |
OLD | NEW |