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

Unified Diff: net/quic/crypto/crypto_secret_boxer.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/crypto/crypto_framer.cc ('k') | net/quic/crypto/null_decrypter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/crypto_secret_boxer.cc
diff --git a/net/quic/crypto/crypto_secret_boxer.cc b/net/quic/crypto/crypto_secret_boxer.cc
index 445d888545b589a819fd79658c4938144c9d8775..b139a6a50fb8e95dd9f8e0b2b4e435cd8891f06b 100644
--- a/net/quic/crypto/crypto_secret_boxer.cc
+++ b/net/quic/crypto/crypto_secret_boxer.cc
@@ -88,15 +88,18 @@ bool CryptoSecretBoxer::Unbox(StringPiece ciphertext,
return false;
}
decrypter->SetNoncePrefix(nonce_prefix);
- scoped_ptr<QuicData> decrypted(
- decrypter->DecryptPacket(sequence_number, StringPiece(), ciphertext));
- if (!decrypted.get()) {
+ char plaintext[kMaxPacketSize];
+ size_t plaintext_length = 0;
+ const bool success = decrypter->DecryptPacket(
+ sequence_number, StringPiece() /* associated data */, ciphertext,
+ plaintext, &plaintext_length, kMaxPacketSize);
+ if (!success) {
return false;
}
- out_storage->resize(decrypted->length());
- out_storage->assign(decrypted->data(), decrypted->length());
- out->set(out_storage->data(), decrypted->length());
+ out_storage->resize(plaintext_length);
+ out_storage->assign(plaintext, plaintext_length);
+ out->set(out_storage->data(), plaintext_length);
return true;
}
« no previous file with comments | « net/quic/crypto/crypto_framer.cc ('k') | net/quic/crypto/null_decrypter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698