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

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

Issue 13483007: Don't set MODE_DEFAULT when adding HPKP header. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable new test on Chrome Frame since it can't work. Created 7 years, 8 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 | « net/http/transport_security_state.h ('k') | net/http/transport_security_state_unittest.cc » ('j') | 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/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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 } 630 }
631 631
632 bool TransportSecurityState::AddHPKPHeader(const std::string& host, 632 bool TransportSecurityState::AddHPKPHeader(const std::string& host,
633 const std::string& value, 633 const std::string& value,
634 const SSLInfo& ssl_info) { 634 const SSLInfo& ssl_info) {
635 base::Time now = base::Time::Now(); 635 base::Time now = base::Time::Now();
636 TransportSecurityState::DomainState domain_state; 636 TransportSecurityState::DomainState domain_state;
637 if (ParseHPKPHeader(now, value, ssl_info.public_key_hashes, 637 if (ParseHPKPHeader(now, value, ssl_info.public_key_hashes,
638 &domain_state.dynamic_spki_hashes_expiry, 638 &domain_state.dynamic_spki_hashes_expiry,
639 &domain_state.dynamic_spki_hashes)) { 639 &domain_state.dynamic_spki_hashes)) {
640 domain_state.upgrade_mode = DomainState::MODE_DEFAULT;
641 domain_state.created = now; 640 domain_state.created = now;
642 EnableHost(host, domain_state); 641 EnableHost(host, domain_state);
643 return true; 642 return true;
644 } 643 }
645 return false; 644 return false;
646 } 645 }
647 646
648 bool TransportSecurityState::AddHSTS(const std::string& host, 647 bool TransportSecurityState::AddHSTS(const std::string& host,
649 const base::Time& expiry, 648 const base::Time& expiry,
650 bool include_subdomains) { 649 bool include_subdomains) {
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 return true; 844 return true;
846 } 845 }
847 846
848 bool TransportSecurityState::DomainState::HasPublicKeyPins() const { 847 bool TransportSecurityState::DomainState::HasPublicKeyPins() const {
849 return static_spki_hashes.size() > 0 || 848 return static_spki_hashes.size() > 0 ||
850 bad_static_spki_hashes.size() > 0 || 849 bad_static_spki_hashes.size() > 0 ||
851 dynamic_spki_hashes.size() > 0; 850 dynamic_spki_hashes.size() > 0;
852 } 851 }
853 852
854 } // namespace 853 } // namespace
OLDNEW
« no previous file with comments | « net/http/transport_security_state.h ('k') | net/http/transport_security_state_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698