Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(894)

Side by Side Diff: net/base/transport_security_state.cc

Issue 10802067: net: don't crash when failing dynamic pins. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698