| 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 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/build_time.h" | 10 #include "base/build_time.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 // Whether the build is not older than 10 weeks. The value is meaningful only | 178 // Whether the build is not older than 10 weeks. The value is meaningful only |
| 179 // if |ct_presence_required| is true. | 179 // if |ct_presence_required| is true. |
| 180 bool build_timely; | 180 bool build_timely; |
| 181 // Compliance status - meaningful only if |ct_presence_required| and | 181 // Compliance status - meaningful only if |ct_presence_required| and |
| 182 // |build_timely| are true. | 182 // |build_timely| are true. |
| 183 CTComplianceStatus status; | 183 CTComplianceStatus status; |
| 184 // EV whitelist version. | 184 // EV whitelist version. |
| 185 base::Version whitelist_version; | 185 base::Version whitelist_version; |
| 186 }; | 186 }; |
| 187 | 187 |
| 188 base::Value* NetLogComplianceCheckResultCallback(X509Certificate* cert, | 188 base::Value* NetLogComplianceCheckResultCallback( |
| 189 ComplianceDetails* details, | 189 X509Certificate* cert, |
| 190 NetLog::LogLevel log_level) { | 190 ComplianceDetails* details, |
| 191 NetLogCaptureMode capture_mode) { |
| 191 base::DictionaryValue* dict = new base::DictionaryValue(); | 192 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 192 dict->Set("certificate", NetLogX509CertificateCallback(cert, log_level)); | 193 dict->Set("certificate", NetLogX509CertificateCallback(cert, capture_mode)); |
| 193 dict->SetBoolean("policy_enforcement_required", | 194 dict->SetBoolean("policy_enforcement_required", |
| 194 details->ct_presence_required); | 195 details->ct_presence_required); |
| 195 if (details->ct_presence_required) { | 196 if (details->ct_presence_required) { |
| 196 dict->SetBoolean("build_timely", details->build_timely); | 197 dict->SetBoolean("build_timely", details->build_timely); |
| 197 if (details->build_timely) { | 198 if (details->build_timely) { |
| 198 dict->SetString("ct_compliance_status", | 199 dict->SetString("ct_compliance_status", |
| 199 ComplianceStatusToString(details->status)); | 200 ComplianceStatusToString(details->status)); |
| 200 if (details->whitelist_version.IsValid()) | 201 if (details->whitelist_version.IsValid()) |
| 201 dict->SetString("ev_whitelist_version", | 202 dict->SetString("ev_whitelist_version", |
| 202 details->whitelist_version.GetString()); | 203 details->whitelist_version.GetString()); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 | 283 |
| 283 LogCTComplianceStatusToUMA(details.status, ev_whitelist); | 284 LogCTComplianceStatusToUMA(details.status, ev_whitelist); |
| 284 | 285 |
| 285 if (details.status == CT_IN_WHITELIST || details.status == CT_ENOUGH_SCTS) | 286 if (details.status == CT_IN_WHITELIST || details.status == CT_ENOUGH_SCTS) |
| 286 return true; | 287 return true; |
| 287 | 288 |
| 288 return false; | 289 return false; |
| 289 } | 290 } |
| 290 | 291 |
| 291 } // namespace net | 292 } // namespace net |
| OLD | NEW |