Chromium Code Reviews| Index: net/cert/multi_log_ct_verifier.cc |
| diff --git a/net/cert/multi_log_ct_verifier.cc b/net/cert/multi_log_ct_verifier.cc |
| index 8a2a823cf88dab7c80fdf61f55afc5c15117b7e6..3c070ce54f1cc5dc1c020507aaf2d106bdfed4df 100644 |
| --- a/net/cert/multi_log_ct_verifier.cc |
| +++ b/net/cert/multi_log_ct_verifier.cc |
| @@ -4,10 +4,14 @@ |
| #include "net/cert/multi_log_ct_verifier.h" |
| +#include "base/bind.h" |
| +#include "base/callback_helpers.h" |
| #include "net/base/net_errors.h" |
| +#include "net/base/net_log.h" |
| #include "net/cert/ct_log_verifier.h" |
| #include "net/cert/ct_objects_extractor.h" |
| #include "net/cert/ct_serialization.h" |
| +#include "net/cert/ct_signed_certificate_timestamp_log_param.h" |
| #include "net/cert/ct_verify_result.h" |
| #include "net/cert/x509_certificate.h" |
| @@ -30,7 +34,8 @@ int MultiLogCTVerifier::Verify( |
| X509Certificate* cert, |
| const std::string& sct_list_from_ocsp, |
| const std::string& sct_list_from_tls_extension, |
| - ct::CTVerifyResult* result) { |
| + ct::CTVerifyResult* result, |
| + const BoundNetLog& net_log) { |
| DCHECK(cert); |
| DCHECK(result); |
| @@ -59,21 +64,37 @@ int MultiLogCTVerifier::Verify( |
| result); |
| } |
| + // Log to Net Log here, after extracting embedded SCTs but before |
|
eroman
2013/11/27 22:33:46
nit: Remove "here,"
Eran M. (Google)
2013/11/29 11:14:44
Done.
|
| + // possibly failing on X.509 entry creation. |
| + NetLog::ParametersCallback net_log_callback = |
| + base::Bind(&NetLogRawSignedCertificateTimestampCallback, |
|
eroman
2013/11/27 22:33:46
style: Indent continued lines by 4.
Eran M. (Google)
2013/11/29 11:14:44
Done.
Eran M. (Google)
2013/11/29 11:14:44
Done.
|
| + &embedded_scts, &sct_list_from_ocsp, &sct_list_from_tls_extension); |
| + |
| + net_log.AddEvent( |
| + NetLog::TYPE_SIGNED_CERTIFICATE_TIMESTAMPS_RECEIVED, |
| + net_log_callback); |
| + |
| ct::LogEntry x509_entry; |
| - if (!ct::GetX509LogEntry(cert->os_cert_handle(), &x509_entry)) |
| - return has_verified_scts ? OK : ERR_FAILED; |
| - |
| - has_verified_scts |= VerifySCTs( |
| - sct_list_from_ocsp, |
| - x509_entry, |
| - ct::SignedCertificateTimestamp::SCT_FROM_OCSP_RESPONSE, |
| - result); |
| - |
| - has_verified_scts |= VerifySCTs( |
| - sct_list_from_tls_extension, |
| - x509_entry, |
| - ct::SignedCertificateTimestamp::SCT_FROM_TLS_EXTENSION, |
| - result); |
| + if (ct::GetX509LogEntry(cert->os_cert_handle(), &x509_entry)) { |
| + has_verified_scts |= VerifySCTs( |
| + sct_list_from_ocsp, |
| + x509_entry, |
| + ct::SignedCertificateTimestamp::SCT_FROM_OCSP_RESPONSE, |
| + result); |
| + |
| + has_verified_scts |= VerifySCTs( |
| + sct_list_from_tls_extension, |
| + x509_entry, |
| + ct::SignedCertificateTimestamp::SCT_FROM_TLS_EXTENSION, |
| + result); |
| + } |
| + |
| + NetLog::ParametersCallback net_log_checked_callback = |
| + base::Bind(&NetLogSignedCertificateTimestampCallback, result); |
|
eroman
2013/11/27 22:33:46
indent continued lines by 4.
Eran M. (Google)
2013/11/29 11:14:44
Done.
|
| + |
| + net_log.AddEvent( |
| + NetLog::TYPE_SIGNED_CERTIFICATE_TIMESTAMPS_CHECKED, |
| + net_log_checked_callback); |
| if (has_verified_scts) |
| return OK; |