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

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

Issue 10830118: net: add codereview sites to HSTS preloaded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 // The validated certificate chain for the site must not include any of 574 // The validated certificate chain for the site must not include any of
575 // |excluded_hashes| and must include one or more of |required_hashes|. 575 // |excluded_hashes| and must include one or more of |required_hashes|.
576 struct PublicKeyPins { 576 struct PublicKeyPins {
577 const char* const* required_hashes; 577 const char* const* required_hashes;
578 const char* const* excluded_hashes; 578 const char* const* excluded_hashes;
579 }; 579 };
580 580
581 struct HSTSPreload { 581 struct HSTSPreload {
582 uint8 length; 582 uint8 length;
583 bool include_subdomains; 583 bool include_subdomains;
584 char dns_name[30]; 584 char dns_name[34];
585 bool https_required; 585 bool https_required;
586 PublicKeyPins pins; 586 PublicKeyPins pins;
587 SecondLevelDomainName second_level_domain_name; 587 SecondLevelDomainName second_level_domain_name;
588 }; 588 };
589 589
590 static bool HasPreload(const struct HSTSPreload* entries, size_t num_entries, 590 static bool HasPreload(const struct HSTSPreload* entries, size_t num_entries,
591 const std::string& canonicalized_host, size_t i, 591 const std::string& canonicalized_host, size_t i,
592 TransportSecurityState::DomainState* out, bool* ret) { 592 TransportSecurityState::DomainState* out, bool* ret) {
593 for (size_t j = 0; j < num_entries; j++) { 593 for (size_t j = 0; j < num_entries; j++) {
594 if (entries[j].length == canonicalized_host.size() - i && 594 if (entries[j].length == canonicalized_host.size() - i &&
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 return true; 801 return true;
802 } 802 }
803 803
804 bool TransportSecurityState::DomainState::HasPins() const { 804 bool TransportSecurityState::DomainState::HasPins() const {
805 return static_spki_hashes.size() > 0 || 805 return static_spki_hashes.size() > 0 ||
806 bad_static_spki_hashes.size() > 0 || 806 bad_static_spki_hashes.size() > 0 ||
807 dynamic_spki_hashes.size() > 0; 807 dynamic_spki_hashes.size() > 0;
808 } 808 }
809 809
810 } // namespace 810 } // namespace
OLDNEW
« no previous file with comments | « no previous file | net/base/transport_security_state_static.h » ('j') | net/base/transport_security_state_static.json » ('J')

Powered by Google App Engine
This is Rietveld 408576698