| 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/chromium/crypto/proof_verifier_chromium.h" | 5 #include "net/quic/chromium/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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 reinterpret_cast<const uint8_t*>(spki.data()), | 508 reinterpret_cast<const uint8_t*>(spki.data()), |
| 509 spki.size())) { | 509 spki.size())) { |
| 510 DLOG(WARNING) << "VerifyInit failed"; | 510 DLOG(WARNING) << "VerifyInit failed"; |
| 511 return false; | 511 return false; |
| 512 } | 512 } |
| 513 } else { | 513 } else { |
| 514 LOG(ERROR) << "Unsupported public key type " << type; | 514 LOG(ERROR) << "Unsupported public key type " << type; |
| 515 return false; | 515 return false; |
| 516 } | 516 } |
| 517 | 517 |
| 518 if (quic_version <= QUIC_VERSION_30) { | 518 verifier.VerifyUpdate( |
| 519 verifier.VerifyUpdate( | 519 reinterpret_cast<const uint8_t*>(kProofSignatureLabel), |
| 520 reinterpret_cast<const uint8_t*>(kProofSignatureLabelOld), | 520 sizeof(kProofSignatureLabel)); |
| 521 sizeof(kProofSignatureLabelOld)); | 521 uint32_t len = chlo_hash.length(); |
| 522 } else { | 522 verifier.VerifyUpdate(reinterpret_cast<const uint8_t*>(&len), sizeof(len)); |
| 523 verifier.VerifyUpdate( | 523 verifier.VerifyUpdate(reinterpret_cast<const uint8_t*>(chlo_hash.data()), |
| 524 reinterpret_cast<const uint8_t*>(kProofSignatureLabel), | 524 len); |
| 525 sizeof(kProofSignatureLabel)); | |
| 526 uint32_t len = chlo_hash.length(); | |
| 527 verifier.VerifyUpdate(reinterpret_cast<const uint8_t*>(&len), sizeof(len)); | |
| 528 verifier.VerifyUpdate(reinterpret_cast<const uint8_t*>(chlo_hash.data()), | |
| 529 len); | |
| 530 } | |
| 531 | 525 |
| 532 verifier.VerifyUpdate(reinterpret_cast<const uint8_t*>(signed_data.data()), | 526 verifier.VerifyUpdate(reinterpret_cast<const uint8_t*>(signed_data.data()), |
| 533 signed_data.size()); | 527 signed_data.size()); |
| 534 | 528 |
| 535 if (!verifier.VerifyFinal()) { | 529 if (!verifier.VerifyFinal()) { |
| 536 DLOG(WARNING) << "VerifyFinal failed"; | 530 DLOG(WARNING) << "VerifyFinal failed"; |
| 537 return false; | 531 return false; |
| 538 } | 532 } |
| 539 | 533 |
| 540 DVLOG(1) << "VerifyFinal success"; | 534 DVLOG(1) << "VerifyFinal success"; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 active_jobs_.insert(job.release()); | 608 active_jobs_.insert(job.release()); |
| 615 return status; | 609 return status; |
| 616 } | 610 } |
| 617 | 611 |
| 618 void ProofVerifierChromium::OnJobComplete(Job* job) { | 612 void ProofVerifierChromium::OnJobComplete(Job* job) { |
| 619 active_jobs_.erase(job); | 613 active_jobs_.erase(job); |
| 620 delete job; | 614 delete job; |
| 621 } | 615 } |
| 622 | 616 |
| 623 } // namespace net | 617 } // namespace net |
| OLD | NEW |