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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 UMA_HISTOGRAM_BOOLEAN("Net.PublicKeyPinSuccess", false); | 283 UMA_HISTOGRAM_BOOLEAN("Net.PublicKeyPinSuccess", false); |
284 TransportSecurityState::ReportUMAOnPinFailure(host); | 284 TransportSecurityState::ReportUMAOnPinFailure(host); |
285 } else { | 285 } else { |
286 UMA_HISTOGRAM_BOOLEAN("Net.PublicKeyPinSuccess", true); | 286 UMA_HISTOGRAM_BOOLEAN("Net.PublicKeyPinSuccess", true); |
287 } | 287 } |
288 } | 288 } |
289 } | 289 } |
290 #endif | 290 #endif |
291 | 291 |
292 if (result != OK) { | 292 if (result != OK) { |
| 293 std::string error_string = ErrorToString(result); |
293 error_details_ = StringPrintf("Failed to verify certificate chain: %s", | 294 error_details_ = StringPrintf("Failed to verify certificate chain: %s", |
294 ErrorToString(result)); | 295 error_string.c_str()); |
295 DLOG(WARNING) << error_details_; | 296 DLOG(WARNING) << error_details_; |
296 } | 297 } |
297 | 298 |
298 // Exit DoLoop and return the result to the caller to VerifyProof. | 299 // Exit DoLoop and return the result to the caller to VerifyProof. |
299 DCHECK_EQ(STATE_NONE, next_state_); | 300 DCHECK_EQ(STATE_NONE, next_state_); |
300 return result; | 301 return result; |
301 } | 302 } |
302 | 303 |
303 bool ProofVerifierChromium::Job::VerifySignature(const string& signed_data, | 304 bool ProofVerifierChromium::Job::VerifySignature(const string& signed_data, |
304 const string& signature, | 305 const string& signature, |
305 const string& cert) { | 306 const string& cert) { |
306 StringPiece spki; | 307 StringPiece spki; |
307 if (!asn1::ExtractSPKIFromDERCert(cert, &spki)) { | 308 if (!asn1::ExtractSPKIFromDERCert(cert, &spki)) { |
308 DLOG(WARNING) << "ExtractSPKIFromDERCert failed"; | 309 DLOG(WARNING) << "ExtractSPKIFromDERCert failed"; |
309 return false; | 310 return false; |
310 } | 311 } |
311 | 312 |
312 crypto::SignatureVerifier verifier; | 313 crypto::SignatureVerifier verifier; |
313 | 314 |
314 size_t size_bits; | 315 size_t size_bits; |
315 X509Certificate::PublicKeyType type; | 316 X509Certificate::PublicKeyType type; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 } | 415 } |
415 return status; | 416 return status; |
416 } | 417 } |
417 | 418 |
418 void ProofVerifierChromium::OnJobComplete(Job* job) { | 419 void ProofVerifierChromium::OnJobComplete(Job* job) { |
419 active_jobs_.erase(job); | 420 active_jobs_.erase(job); |
420 delete job; | 421 delete job; |
421 } | 422 } |
422 | 423 |
423 } // namespace net | 424 } // namespace net |
OLD | NEW |