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

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

Issue 826423009: Treat HSTS and HPKP state independently. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rsleevi comments Created 5 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
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 "base/base64.h" 5 #include "base/base64.h"
6 #include "base/basictypes.h" 6 #include "base/basictypes.h"
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "base/strings/string_tokenizer.h" 8 #include "base/strings/string_tokenizer.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "net/http/http_security_headers.h" 10 #include "net/http/http_security_headers.h"
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 } 316 }
317 317
318 if (!parsed_max_age) 318 if (!parsed_max_age)
319 return false; 319 return false;
320 320
321 if (!IsPinListValid(pins, chain_hashes)) 321 if (!IsPinListValid(pins, chain_hashes))
322 return false; 322 return false;
323 323
324 *max_age = base::TimeDelta::FromSeconds(max_age_candidate); 324 *max_age = base::TimeDelta::FromSeconds(max_age_candidate);
325 *include_subdomains = include_subdomains_candidate; 325 *include_subdomains = include_subdomains_candidate;
326 for (HashValueVector::const_iterator i = pins.begin(); 326 hashes->swap(pins);
327 i != pins.end(); ++i) {
328 bool found = false;
329
330 for (HashValueVector::const_iterator j = hashes->begin();
331 j != hashes->end(); ++j) {
332 if (j->Equals(*i)) {
333 found = true;
334 break;
335 }
336 }
337
338 if (!found)
339 hashes->push_back(*i);
340 }
341 327
342 return true; 328 return true;
343 } 329 }
344 330
345 } // namespace net 331 } // namespace net
OLDNEW
« no previous file with comments | « chrome/test/data/webui/net_internals/hsts_view.js ('k') | net/http/http_security_headers_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698