Chromium Code Reviews| 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 #include "net/http/transport_security_state.h" | 5 #include "net/http/transport_security_state.h" |
| 6 | 6 |
| 7 #if defined(USE_OPENSSL) | 7 #if defined(USE_OPENSSL) |
| 8 #include <openssl/ecdsa.h> | 8 #include <openssl/ecdsa.h> |
| 9 #include <openssl/ssl.h> | 9 #include <openssl/ssl.h> |
| 10 #else // !defined(USE_OPENSSL) | 10 #else // !defined(USE_OPENSSL) |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 534 // The validated certificate chain for the site must not include any of | 534 // The validated certificate chain for the site must not include any of |
| 535 // |excluded_hashes| and must include one or more of |required_hashes|. | 535 // |excluded_hashes| and must include one or more of |required_hashes|. |
| 536 struct PublicKeyPins { | 536 struct PublicKeyPins { |
| 537 const char* const* required_hashes; | 537 const char* const* required_hashes; |
| 538 const char* const* excluded_hashes; | 538 const char* const* excluded_hashes; |
| 539 }; | 539 }; |
| 540 | 540 |
| 541 struct HSTSPreload { | 541 struct HSTSPreload { |
| 542 uint8 length; | 542 uint8 length; |
| 543 bool include_subdomains; | 543 bool include_subdomains; |
| 544 char dns_name[34]; | 544 char dns_name[38]; |
|
cbentzel
2013/04/30 18:28:09
Curious: Do long names trigger compile-time warnin
palmer
2013/04/30 18:33:09
Yep. (Thankfully.)
| |
| 545 bool https_required; | 545 bool https_required; |
| 546 PublicKeyPins pins; | 546 PublicKeyPins pins; |
| 547 SecondLevelDomainName second_level_domain_name; | 547 SecondLevelDomainName second_level_domain_name; |
| 548 }; | 548 }; |
| 549 | 549 |
| 550 static bool HasPreload(const struct HSTSPreload* entries, size_t num_entries, | 550 static bool HasPreload(const struct HSTSPreload* entries, size_t num_entries, |
| 551 const std::string& canonicalized_host, size_t i, | 551 const std::string& canonicalized_host, size_t i, |
| 552 TransportSecurityState::DomainState* out, bool* ret) { | 552 TransportSecurityState::DomainState* out, bool* ret) { |
| 553 for (size_t j = 0; j < num_entries; j++) { | 553 for (size_t j = 0; j < num_entries; j++) { |
| 554 if (entries[j].length == canonicalized_host.size() - i && | 554 if (entries[j].length == canonicalized_host.size() - i && |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 845 return true; | 845 return true; |
| 846 } | 846 } |
| 847 | 847 |
| 848 bool TransportSecurityState::DomainState::HasPublicKeyPins() const { | 848 bool TransportSecurityState::DomainState::HasPublicKeyPins() const { |
| 849 return static_spki_hashes.size() > 0 || | 849 return static_spki_hashes.size() > 0 || |
| 850 bad_static_spki_hashes.size() > 0 || | 850 bad_static_spki_hashes.size() > 0 || |
| 851 dynamic_spki_hashes.size() > 0; | 851 dynamic_spki_hashes.size() > 0; |
| 852 } | 852 } |
| 853 | 853 |
| 854 } // namespace | 854 } // namespace |
| OLD | NEW |