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

Side by Side Diff: net/cert/ct_known_logs.cc

Issue 2101863004: net: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « net/cert/cert_verifier.cc ('k') | net/cert/multi_threaded_cert_verifier.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/cert/ct_known_logs.h" 5 #include "net/cert/ct_known_logs.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return std::binary_search(std::begin(kGoogleLogIDs), std::end(kGoogleLogIDs), 64 return std::binary_search(std::begin(kGoogleLogIDs), std::end(kGoogleLogIDs),
65 log_id.data(), [](const char* a, const char* b) { 65 log_id.data(), [](const char* a, const char* b) {
66 return memcmp(a, b, crypto::kSHA256Length) < 0; 66 return memcmp(a, b, crypto::kSHA256Length) < 0;
67 }); 67 });
68 } 68 }
69 69
70 bool IsLogDisqualified(base::StringPiece log_id, 70 bool IsLogDisqualified(base::StringPiece log_id,
71 base::Time* disqualification_date) { 71 base::Time* disqualification_date) {
72 CHECK_EQ(log_id.size(), arraysize(kDisqualifiedCTLogList[0].log_id) - 1); 72 CHECK_EQ(log_id.size(), arraysize(kDisqualifiedCTLogList[0].log_id) - 1);
73 73
74 auto p = std::lower_bound( 74 auto* p = std::lower_bound(
75 std::begin(kDisqualifiedCTLogList), std::end(kDisqualifiedCTLogList), 75 std::begin(kDisqualifiedCTLogList), std::end(kDisqualifiedCTLogList),
76 log_id.data(), 76 log_id.data(),
77 [](const DisqualifiedCTLogInfo& disqualified_log, const char* log_id) { 77 [](const DisqualifiedCTLogInfo& disqualified_log, const char* log_id) {
78 return memcmp(disqualified_log.log_id, log_id, crypto::kSHA256Length) < 78 return memcmp(disqualified_log.log_id, log_id, crypto::kSHA256Length) <
79 0; 79 0;
80 }); 80 });
81 if (p == std::end(kDisqualifiedCTLogList) || 81 if (p == std::end(kDisqualifiedCTLogList) ||
82 memcmp(p->log_id, log_id.data(), crypto::kSHA256Length) != 0) { 82 memcmp(p->log_id, log_id.data(), crypto::kSHA256Length) != 0) {
83 return false; 83 return false;
84 } 84 }
85 85
86 *disqualification_date = base::Time::UnixEpoch() + p->disqualification_date; 86 *disqualification_date = base::Time::UnixEpoch() + p->disqualification_date;
87 return true; 87 return true;
88 } 88 }
89 89
90 } // namespace ct 90 } // namespace ct
91 91
92 } // namespace net 92 } // namespace net
93 93
OLDNEW
« no previous file with comments | « net/cert/cert_verifier.cc ('k') | net/cert/multi_threaded_cert_verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698