| OLD | NEW |
| 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 "net/ssl/ssl_info.h" | 5 #include "net/ssl/ssl_info.h" |
| 6 | 6 |
| 7 #include "base/pickle.h" | 7 #include "base/pickle.h" |
| 8 #include "net/cert/cert_status_flags.h" | 8 #include "net/cert/cert_status_flags.h" |
| 9 #include "net/cert/signed_certificate_timestamp.h" | 9 #include "net/cert/signed_certificate_timestamp.h" |
| 10 #include "net/cert/x509_certificate.h" | 10 #include "net/cert/x509_certificate.h" |
| 11 | 11 |
| 12 namespace net { | 12 namespace net { |
| 13 | 13 |
| 14 SSLInfo::CTPolicyComplianceDetails::CTPolicyComplianceDetails() |
| 15 : compliance_details_available(false), |
| 16 ev_policy_compliance(CTPolicyEnforcer::EV_POLICY_DOES_NOT_APPLY) {} |
| 17 |
| 14 SSLInfo::SSLInfo() { | 18 SSLInfo::SSLInfo() { |
| 15 Reset(); | 19 Reset(); |
| 16 } | 20 } |
| 17 | 21 |
| 18 SSLInfo::SSLInfo(const SSLInfo& info) { | 22 SSLInfo::SSLInfo(const SSLInfo& info) { |
| 19 *this = info; | 23 *this = info; |
| 20 } | 24 } |
| 21 | 25 |
| 22 SSLInfo::~SSLInfo() { | 26 SSLInfo::~SSLInfo() { |
| 23 } | 27 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 handshake_type = HANDSHAKE_UNKNOWN; | 61 handshake_type = HANDSHAKE_UNKNOWN; |
| 58 public_key_hashes.clear(); | 62 public_key_hashes.clear(); |
| 59 signed_certificate_timestamps.clear(); | 63 signed_certificate_timestamps.clear(); |
| 60 pinning_failure_log.clear(); | 64 pinning_failure_log.clear(); |
| 61 } | 65 } |
| 62 | 66 |
| 63 void SSLInfo::SetCertError(int error) { | 67 void SSLInfo::SetCertError(int error) { |
| 64 cert_status |= MapNetErrorToCertStatus(error); | 68 cert_status |= MapNetErrorToCertStatus(error); |
| 65 } | 69 } |
| 66 | 70 |
| 67 void SSLInfo::UpdateSignedCertificateTimestamps( | 71 void SSLInfo::UpdateCertificateTransparencyInfo( |
| 68 const ct::CTVerifyResult& ct_verify_result) { | 72 const ct::CTVerifyResult& ct_verify_result) { |
| 69 for (const auto& sct : ct_verify_result.verified_scts) { | 73 for (const auto& sct : ct_verify_result.verified_scts) { |
| 70 signed_certificate_timestamps.push_back( | 74 signed_certificate_timestamps.push_back( |
| 71 SignedCertificateTimestampAndStatus(sct, ct::SCT_STATUS_OK)); | 75 SignedCertificateTimestampAndStatus(sct, ct::SCT_STATUS_OK)); |
| 72 } | 76 } |
| 73 for (const auto& sct : ct_verify_result.invalid_scts) { | 77 for (const auto& sct : ct_verify_result.invalid_scts) { |
| 74 signed_certificate_timestamps.push_back( | 78 signed_certificate_timestamps.push_back( |
| 75 SignedCertificateTimestampAndStatus(sct, ct::SCT_STATUS_INVALID)); | 79 SignedCertificateTimestampAndStatus(sct, ct::SCT_STATUS_INVALID)); |
| 76 } | 80 } |
| 77 for (const auto& sct : ct_verify_result.unknown_logs_scts) { | 81 for (const auto& sct : ct_verify_result.unknown_logs_scts) { |
| 78 signed_certificate_timestamps.push_back( | 82 signed_certificate_timestamps.push_back( |
| 79 SignedCertificateTimestampAndStatus(sct, ct::SCT_STATUS_LOG_UNKNOWN)); | 83 SignedCertificateTimestampAndStatus(sct, ct::SCT_STATUS_LOG_UNKNOWN)); |
| 80 } | 84 } |
| 85 |
| 86 ct_policy_compliance_details.compliance_details_available = |
| 87 ct_verify_result.ct_policies_applied; |
| 88 ct_policy_compliance_details.ev_policy_compliance = |
| 89 ct_verify_result.ev_policy_compliance; |
| 81 } | 90 } |
| 82 | 91 |
| 83 } // namespace net | 92 } // namespace net |
| OLD | NEW |