OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/quic/crypto/proof_verifier_chromium.h" | 5 #include "net/quic/crypto/proof_verifier_chromium.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 DLOG(WARNING) << *error_details; | 205 DLOG(WARNING) << *error_details; |
206 verify_details_->cert_verify_result.cert_status = CERT_STATUS_INVALID; | 206 verify_details_->cert_verify_result.cert_status = CERT_STATUS_INVALID; |
207 *verify_details = std::move(verify_details_); | 207 *verify_details = std::move(verify_details_); |
208 return QUIC_FAILURE; | 208 return QUIC_FAILURE; |
209 } | 209 } |
210 | 210 |
211 if (cert_transparency_verifier_ && !cert_sct.empty()) { | 211 if (cert_transparency_verifier_ && !cert_sct.empty()) { |
212 // Note that this is a completely synchronous operation: The CT Log Verifier | 212 // Note that this is a completely synchronous operation: The CT Log Verifier |
213 // gets all the data it needs for SCT verification and does not do any | 213 // gets all the data it needs for SCT verification and does not do any |
214 // external communication. | 214 // external communication. |
215 cert_transparency_verifier_->Verify(cert_.get(), std::string(), cert_sct, | 215 int result = cert_transparency_verifier_->Verify( |
216 &verify_details_->ct_verify_result, | 216 cert_.get(), std::string(), cert_sct, |
217 net_log_); | 217 &verify_details_->ct_verify_result, net_log_); |
| 218 // TODO(rtenneti): Delete this debugging code. |
| 219 if (result == OK) { |
| 220 VLOG(1) << "CTVerifier::Verify success"; |
| 221 } else { |
| 222 VLOG(1) << "CTVerifier::Verify failed: " << result; |
| 223 } |
| 224 } else { |
| 225 // TODO(rtenneti): Delete this debugging code. |
| 226 if (cert_transparency_verifier_) { |
| 227 VLOG(1) << "cert_sct is empty"; |
| 228 } else { |
| 229 VLOG(1) << "cert_transparency_verifier_ is null"; |
| 230 } |
218 } | 231 } |
219 | 232 |
220 // We call VerifySignature first to avoid copying of server_config and | 233 // We call VerifySignature first to avoid copying of server_config and |
221 // signature. | 234 // signature. |
222 if (!VerifySignature(server_config, quic_version, chlo_hash, signature, | 235 if (!VerifySignature(server_config, quic_version, chlo_hash, signature, |
223 certs[0])) { | 236 certs[0])) { |
224 *error_details = "Failed to verify signature of server config"; | 237 *error_details = "Failed to verify signature of server config"; |
225 DLOG(WARNING) << *error_details; | 238 DLOG(WARNING) << *error_details; |
226 verify_details_->cert_verify_result.cert_status = CERT_STATUS_INVALID; | 239 verify_details_->cert_verify_result.cert_status = CERT_STATUS_INVALID; |
227 *verify_details = std::move(verify_details_); | 240 *verify_details = std::move(verify_details_); |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 } | 483 } |
471 return status; | 484 return status; |
472 } | 485 } |
473 | 486 |
474 void ProofVerifierChromium::OnJobComplete(Job* job) { | 487 void ProofVerifierChromium::OnJobComplete(Job* job) { |
475 active_jobs_.erase(job); | 488 active_jobs_.erase(job); |
476 delete job; | 489 delete job; |
477 } | 490 } |
478 | 491 |
479 } // namespace net | 492 } // namespace net |
OLD | NEW |