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/base/transport_security_state.h" | 5 #include "net/base/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 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 std::string canonicalized_host = CanonicalizeHost(host); | 678 std::string canonicalized_host = CanonicalizeHost(host); |
679 | 679 |
680 const struct HSTSPreload* entry = | 680 const struct HSTSPreload* entry = |
681 GetHSTSPreload(canonicalized_host, kPreloadedSTS, kNumPreloadedSTS); | 681 GetHSTSPreload(canonicalized_host, kPreloadedSTS, kNumPreloadedSTS); |
682 | 682 |
683 if (!entry) { | 683 if (!entry) { |
684 entry = GetHSTSPreload(canonicalized_host, kPreloadedSNISTS, | 684 entry = GetHSTSPreload(canonicalized_host, kPreloadedSNISTS, |
685 kNumPreloadedSNISTS); | 685 kNumPreloadedSNISTS); |
686 } | 686 } |
687 | 687 |
| 688 if (!entry) { |
| 689 // We don't care to report pin failures for dynamic pins. |
| 690 return; |
| 691 } |
| 692 |
688 DCHECK(entry); | 693 DCHECK(entry); |
689 DCHECK(entry->pins.required_hashes); | 694 DCHECK(entry->pins.required_hashes); |
690 DCHECK(entry->second_level_domain_name != DOMAIN_NOT_PINNED); | 695 DCHECK(entry->second_level_domain_name != DOMAIN_NOT_PINNED); |
691 | 696 |
692 UMA_HISTOGRAM_ENUMERATION("Net.PublicKeyPinFailureDomain", | 697 UMA_HISTOGRAM_ENUMERATION("Net.PublicKeyPinFailureDomain", |
693 entry->second_level_domain_name, DOMAIN_NUM_EVENTS); | 698 entry->second_level_domain_name, DOMAIN_NUM_EVENTS); |
694 } | 699 } |
695 | 700 |
696 bool TransportSecurityState::GetStaticDomainState( | 701 bool TransportSecurityState::GetStaticDomainState( |
697 const std::string& canonicalized_host, | 702 const std::string& canonicalized_host, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 return true; | 801 return true; |
797 } | 802 } |
798 | 803 |
799 bool TransportSecurityState::DomainState::HasPins() const { | 804 bool TransportSecurityState::DomainState::HasPins() const { |
800 return static_spki_hashes.size() > 0 || | 805 return static_spki_hashes.size() > 0 || |
801 bad_static_spki_hashes.size() > 0 || | 806 bad_static_spki_hashes.size() > 0 || |
802 dynamic_spki_hashes.size() > 0; | 807 dynamic_spki_hashes.size() > 0; |
803 } | 808 } |
804 | 809 |
805 } // namespace | 810 } // namespace |
OLD | NEW |