| 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/ct_policy_enforcer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/build_time.h" | 11 #include "base/build_time.h" |
| 12 #include "base/callback_helpers.h" | 12 #include "base/callback_helpers.h" |
| 13 #include "base/metrics/field_trial.h" | 13 #include "base/metrics/field_trial.h" |
| 14 #include "base/metrics/histogram_macros.h" | 14 #include "base/metrics/histogram_macros.h" |
| 15 #include "base/numerics/safe_conversions.h" | 15 #include "base/numerics/safe_conversions.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 !HasEnoughDiverseSCTs(ct_result.verified_scts)) { | 289 !HasEnoughDiverseSCTs(ct_result.verified_scts)) { |
| 290 result->status = CT_NOT_ENOUGH_DIVERSE_SCTS; | 290 result->status = CT_NOT_ENOUGH_DIVERSE_SCTS; |
| 291 return; | 291 return; |
| 292 } | 292 } |
| 293 | 293 |
| 294 result->status = CT_ENOUGH_SCTS; | 294 result->status = CT_ENOUGH_SCTS; |
| 295 } | 295 } |
| 296 | 296 |
| 297 } // namespace | 297 } // namespace |
| 298 | 298 |
| 299 bool CertPolicyEnforcer::DoesConformToCTEVPolicy( | 299 bool CTPolicyEnforcer::DoesConformToCTEVPolicy( |
| 300 X509Certificate* cert, | 300 X509Certificate* cert, |
| 301 const ct::EVCertsWhitelist* ev_whitelist, | 301 const ct::EVCertsWhitelist* ev_whitelist, |
| 302 const ct::CTVerifyResult& ct_result, | 302 const ct::CTVerifyResult& ct_result, |
| 303 const BoundNetLog& net_log) { | 303 const BoundNetLog& net_log) { |
| 304 ComplianceDetails details; | 304 ComplianceDetails details; |
| 305 | 305 |
| 306 CheckCTEVPolicyCompliance(cert, ev_whitelist, ct_result, &details); | 306 CheckCTEVPolicyCompliance(cert, ev_whitelist, ct_result, &details); |
| 307 | 307 |
| 308 NetLog::ParametersCallback net_log_callback = | 308 NetLog::ParametersCallback net_log_callback = |
| 309 base::Bind(&NetLogComplianceCheckResultCallback, base::Unretained(cert), | 309 base::Bind(&NetLogComplianceCheckResultCallback, base::Unretained(cert), |
| (...skipping 10 matching lines...) Expand all Loading... |
| 320 | 320 |
| 321 LogCTComplianceStatusToUMA(details.status, ev_whitelist); | 321 LogCTComplianceStatusToUMA(details.status, ev_whitelist); |
| 322 | 322 |
| 323 if (details.status == CT_IN_WHITELIST || details.status == CT_ENOUGH_SCTS) | 323 if (details.status == CT_IN_WHITELIST || details.status == CT_ENOUGH_SCTS) |
| 324 return true; | 324 return true; |
| 325 | 325 |
| 326 return false; | 326 return false; |
| 327 } | 327 } |
| 328 | 328 |
| 329 } // namespace net | 329 } // namespace net |
| OLD | NEW |