OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/cert_policy_enforcer.h" | 5 #include "net/cert/cert_policy_enforcer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> |
8 | 9 |
9 #include "base/bind.h" | 10 #include "base/bind.h" |
10 #include "base/build_time.h" | 11 #include "base/build_time.h" |
11 #include "base/callback_helpers.h" | 12 #include "base/callback_helpers.h" |
12 #include "base/metrics/field_trial.h" | 13 #include "base/metrics/field_trial.h" |
13 #include "base/metrics/histogram_macros.h" | 14 #include "base/metrics/histogram_macros.h" |
14 #include "base/numerics/safe_conversions.h" | 15 #include "base/numerics/safe_conversions.h" |
15 #include "base/strings/string_number_conversions.h" | 16 #include "base/strings/string_number_conversions.h" |
16 #include "base/time/time.h" | 17 #include "base/time/time.h" |
17 #include "base/values.h" | 18 #include "base/values.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 if (details->ct_presence_required) { | 217 if (details->ct_presence_required) { |
217 dict->SetBoolean("build_timely", details->build_timely); | 218 dict->SetBoolean("build_timely", details->build_timely); |
218 if (details->build_timely) { | 219 if (details->build_timely) { |
219 dict->SetString("ct_compliance_status", | 220 dict->SetString("ct_compliance_status", |
220 ComplianceStatusToString(details->status)); | 221 ComplianceStatusToString(details->status)); |
221 if (details->whitelist_version.IsValid()) | 222 if (details->whitelist_version.IsValid()) |
222 dict->SetString("ev_whitelist_version", | 223 dict->SetString("ev_whitelist_version", |
223 details->whitelist_version.GetString()); | 224 details->whitelist_version.GetString()); |
224 } | 225 } |
225 } | 226 } |
226 return dict.Pass(); | 227 return std::move(dict); |
227 } | 228 } |
228 | 229 |
229 // Returns true if all SCTs in |verified_scts| were issued on, or after, the | 230 // Returns true if all SCTs in |verified_scts| were issued on, or after, the |
230 // date specified in kDiverseSCTRequirementStartDate | 231 // date specified in kDiverseSCTRequirementStartDate |
231 bool AllSCTsPastDistinctSCTRequirementEnforcementDate( | 232 bool AllSCTsPastDistinctSCTRequirementEnforcementDate( |
232 const ct::SCTList& verified_scts) { | 233 const ct::SCTList& verified_scts) { |
233 // The date when diverse SCTs requirement is effective from. | 234 // The date when diverse SCTs requirement is effective from. |
234 // 2015-07-01 00:00:00 UTC. | 235 // 2015-07-01 00:00:00 UTC. |
235 base::Time kDiverseSCTRequirementStartDate = | 236 base::Time kDiverseSCTRequirementStartDate = |
236 base::Time::FromInternalValue(13080182400000000); | 237 base::Time::FromInternalValue(13080182400000000); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 | 320 |
320 LogCTComplianceStatusToUMA(details.status, ev_whitelist); | 321 LogCTComplianceStatusToUMA(details.status, ev_whitelist); |
321 | 322 |
322 if (details.status == CT_IN_WHITELIST || details.status == CT_ENOUGH_SCTS) | 323 if (details.status == CT_IN_WHITELIST || details.status == CT_ENOUGH_SCTS) |
323 return true; | 324 return true; |
324 | 325 |
325 return false; | 326 return false; |
326 } | 327 } |
327 | 328 |
328 } // namespace net | 329 } // namespace net |
OLD | NEW |