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

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

Issue 1574423003: Revert of Add a whitelist for QUIC hosts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « net/http/transport_security_state.h ('k') | net/quic/quic_network_transaction_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 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after
1093 while (*sha256_hash) { 1093 while (*sha256_hash) {
1094 AddHash(*sha256_hash, &pkp_state->bad_spki_hashes); 1094 AddHash(*sha256_hash, &pkp_state->bad_spki_hashes);
1095 sha256_hash++; 1095 sha256_hash++;
1096 } 1096 }
1097 } 1097 }
1098 } 1098 }
1099 1099
1100 return true; 1100 return true;
1101 } 1101 }
1102 1102
1103 bool TransportSecurityState::IsGooglePinnedHost(const std::string& host) const {
1104 DCHECK(CalledOnValidThread());
1105
1106 if (!IsBuildTimely())
1107 return false;
1108
1109 PreloadResult result;
1110 if (!DecodeHSTSPreload(host, &result))
1111 return false;
1112
1113 if (!result.has_pins)
1114 return false;
1115
1116 if (result.pinset_id >= arraysize(kPinsets))
1117 return false;
1118
1119 return kPinsets[result.pinset_id].accepted_pins == kGoogleAcceptableCerts;
1120 }
1121
1122 bool TransportSecurityState::GetStaticExpectCTState( 1103 bool TransportSecurityState::GetStaticExpectCTState(
1123 const std::string& host, 1104 const std::string& host,
1124 ExpectCTState* expect_ct_state) const { 1105 ExpectCTState* expect_ct_state) const {
1125 DCHECK(CalledOnValidThread()); 1106 DCHECK(CalledOnValidThread());
1126 1107
1127 if (!IsBuildTimely()) 1108 if (!IsBuildTimely())
1128 return false; 1109 return false;
1129 1110
1130 PreloadResult result; 1111 PreloadResult result;
1131 if (!DecodeHSTSPreload(host, &result)) 1112 if (!DecodeHSTSPreload(host, &result))
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 TransportSecurityState::PKPStateIterator::PKPStateIterator( 1299 TransportSecurityState::PKPStateIterator::PKPStateIterator(
1319 const TransportSecurityState& state) 1300 const TransportSecurityState& state)
1320 : iterator_(state.enabled_pkp_hosts_.begin()), 1301 : iterator_(state.enabled_pkp_hosts_.begin()),
1321 end_(state.enabled_pkp_hosts_.end()) { 1302 end_(state.enabled_pkp_hosts_.end()) {
1322 } 1303 }
1323 1304
1324 TransportSecurityState::PKPStateIterator::~PKPStateIterator() { 1305 TransportSecurityState::PKPStateIterator::~PKPStateIterator() {
1325 } 1306 }
1326 1307
1327 } // namespace 1308 } // namespace
OLDNEW
« no previous file with comments | « net/http/transport_security_state.h ('k') | net/quic/quic_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698