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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
245 // Adds explicitly-specified data as if it was processed from an | 245 // Adds explicitly-specified data as if it was processed from an |
246 // HSTS header (used for net-internals and unit tests). | 246 // HSTS header (used for net-internals and unit tests). |
247 bool AddHSTS(const std::string& host, const base::Time& expiry, | 247 bool AddHSTS(const std::string& host, const base::Time& expiry, |
248 bool include_subdomains); | 248 bool include_subdomains); |
249 | 249 |
250 // Adds explicitly-specified data as if it was processed from an | 250 // Adds explicitly-specified data as if it was processed from an |
251 // HPKP header (used for net-internals and unit tests). | 251 // HPKP header (used for net-internals and unit tests). |
252 bool AddHPKP(const std::string& host, const base::Time& expiry, | 252 bool AddHPKP(const std::string& host, const base::Time& expiry, |
253 bool include_subdomains, const HashValueVector& hashes); | 253 bool include_subdomains, const HashValueVector& hashes); |
254 | 254 |
255 // Returns true if |public_key_hashes| meets the pinning constrains of | |
palmer
2014/08/07 18:50:50
typo: "constraints"
Can we call it |ValidatePins|
Ryan Hamilton
2014/08/07 22:07:11
Acknowledged.
| |
256 // |host|, or if the build is out of date, or if the root is not a | |
257 // built-in trusted root. |pinning_failure_log| is written to in the | |
258 // case of a pinning failure. | |
259 bool VerifyPinning(const HashValueVector& public_key_hashes, | |
260 bool is_issued_by_known_root, | |
palmer
2014/08/07 18:50:50
If the caller knows |is_issued_by_known_root|, the
Ryan Hamilton
2014/08/07 22:07:11
Personally, I think it does because it focuses the
| |
261 bool sni_available, | |
262 const std::string& host, | |
263 std::string* pinning_failure_log); | |
264 | |
255 // Returns true iff we have any static public key pins for the |host| and | 265 // Returns true iff we have any static public key pins for the |host| and |
256 // iff its set of required pins is the set we expect for Google | 266 // iff its set of required pins is the set we expect for Google |
257 // properties. | 267 // properties. |
258 // | 268 // |
259 // If |sni_enabled| is true, searches the static pins defined for | 269 // If |sni_enabled| is true, searches the static pins defined for |
260 // SNI-using hosts as well as the rest of the pins. | 270 // SNI-using hosts as well as the rest of the pins. |
261 // | 271 // |
262 // If |host| matches both an exact entry and is a subdomain of another | 272 // If |host| matches both an exact entry and is a subdomain of another |
263 // entry, the exact match determines the return value. | 273 // entry, the exact match determines the return value. |
264 static bool IsGooglePinnedProperty(const std::string& host, | 274 static bool IsGooglePinnedProperty(const std::string& host, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
308 DomainStateMap enabled_hosts_; | 318 DomainStateMap enabled_hosts_; |
309 | 319 |
310 Delegate* delegate_; | 320 Delegate* delegate_; |
311 | 321 |
312 DISALLOW_COPY_AND_ASSIGN(TransportSecurityState); | 322 DISALLOW_COPY_AND_ASSIGN(TransportSecurityState); |
313 }; | 323 }; |
314 | 324 |
315 } // namespace net | 325 } // namespace net |
316 | 326 |
317 #endif // NET_HTTP_TRANSPORT_SECURITY_STATE_H_ | 327 #endif // NET_HTTP_TRANSPORT_SECURITY_STATE_H_ |
OLD | NEW |