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> |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 // the specified pins overlap with the certificate chain. | 285 // the specified pins overlap with the certificate chain. |
286 bool AddHPKPHeader(const std::string& host, const std::string& value, | 286 bool AddHPKPHeader(const std::string& host, const std::string& value, |
287 const SSLInfo& ssl_info); | 287 const SSLInfo& ssl_info); |
288 | 288 |
289 // Adds explicitly-specified data as if it was processed from an | 289 // Adds explicitly-specified data as if it was processed from an |
290 // HSTS header (used for net-internals and unit tests). | 290 // HSTS header (used for net-internals and unit tests). |
291 void AddHSTS(const std::string& host, | 291 void AddHSTS(const std::string& host, |
292 const base::Time& expiry, | 292 const base::Time& expiry, |
293 bool include_subdomains); | 293 bool include_subdomains); |
294 | 294 |
295 // Adds explicitly-specified data as if it was processed from an | 295 // Adds explicitly-specified data as if it was processed from an HPKP header. |
296 // HPKP header (used for net-internals and unit tests). | 296 // Note: This method will persist the HPKP if a Delegate is present. Make sure |
| 297 // that the delegate is nullptr if the persistence is not desired. |
| 298 // See |SetDelegate| method for more details. |
297 void AddHPKP(const std::string& host, | 299 void AddHPKP(const std::string& host, |
298 const base::Time& expiry, | 300 const base::Time& expiry, |
299 bool include_subdomains, | 301 bool include_subdomains, |
300 const HashValueVector& hashes, | 302 const HashValueVector& hashes, |
301 const GURL& report_uri); | 303 const GURL& report_uri); |
302 | 304 |
303 // Parses |value| as a Public-Key-Pins-Report-Only header value and | 305 // Parses |value| as a Public-Key-Pins-Report-Only header value and |
304 // sends a HPKP report for |host_port_pair| if |ssl_info| violates the | 306 // sends a HPKP report for |host_port_pair| if |ssl_info| violates the |
305 // pin. Returns true if |value| parses and includes a valid | 307 // pin. Returns true if |value| parses and includes a valid |
306 // report-uri, and false otherwise. | 308 // report-uri, and false otherwise. |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 // rate-limiting. | 406 // rate-limiting. |
405 ExpiringCache<std::string, bool, base::TimeTicks, std::less<base::TimeTicks>> | 407 ExpiringCache<std::string, bool, base::TimeTicks, std::less<base::TimeTicks>> |
406 sent_reports_cache_; | 408 sent_reports_cache_; |
407 | 409 |
408 DISALLOW_COPY_AND_ASSIGN(TransportSecurityState); | 410 DISALLOW_COPY_AND_ASSIGN(TransportSecurityState); |
409 }; | 411 }; |
410 | 412 |
411 } // namespace net | 413 } // namespace net |
412 | 414 |
413 #endif // NET_HTTP_TRANSPORT_SECURITY_STATE_H_ | 415 #endif // NET_HTTP_TRANSPORT_SECURITY_STATE_H_ |
OLD | NEW |