Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: net/quic/chromium/crypto/proof_verifier_chromium.cc

Issue 2403193003: Landing Recent QUIC changes until 9:41 AM, Oct 10, 2016 UTC-7 (Closed)
Patch Set: git cl format Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(reinterpret_cast<const uint8_t*>(kProofSignatureLabel),
519 verifier.VerifyUpdate( 519 sizeof(kProofSignatureLabel));
520 reinterpret_cast<const uint8_t*>(kProofSignatureLabelOld), 520 uint32_t len = chlo_hash.length();
521 sizeof(kProofSignatureLabelOld)); 521 verifier.VerifyUpdate(reinterpret_cast<const uint8_t*>(&len), sizeof(len));
522 } else { 522 verifier.VerifyUpdate(reinterpret_cast<const uint8_t*>(chlo_hash.data()),
523 verifier.VerifyUpdate( 523 len);
524 reinterpret_cast<const uint8_t*>(kProofSignatureLabel),
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 524
532 verifier.VerifyUpdate(reinterpret_cast<const uint8_t*>(signed_data.data()), 525 verifier.VerifyUpdate(reinterpret_cast<const uint8_t*>(signed_data.data()),
533 signed_data.size()); 526 signed_data.size());
534 527
535 if (!verifier.VerifyFinal()) { 528 if (!verifier.VerifyFinal()) {
536 DLOG(WARNING) << "VerifyFinal failed"; 529 DLOG(WARNING) << "VerifyFinal failed";
537 return false; 530 return false;
538 } 531 }
539 532
540 DVLOG(1) << "VerifyFinal success"; 533 DVLOG(1) << "VerifyFinal success";
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 active_jobs_.insert(job.release()); 607 active_jobs_.insert(job.release());
615 return status; 608 return status;
616 } 609 }
617 610
618 void ProofVerifierChromium::OnJobComplete(Job* job) { 611 void ProofVerifierChromium::OnJobComplete(Job* job) {
619 active_jobs_.erase(job); 612 active_jobs_.erase(job);
620 delete job; 613 delete job;
621 } 614 }
622 615
623 } // namespace net 616 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/chromium/crypto/proof_test_chromium.cc ('k') | net/quic/core/congestion_control/general_loss_algorithm.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698