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

Unified Diff: net/quic/crypto/aes_128_gcm_12_decrypter_test.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/aes_128_gcm_12_decrypter_nss.cc ('k') | net/quic/crypto/chacha20_poly1305_decrypter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/aes_128_gcm_12_decrypter_test.cc
diff --git a/net/quic/crypto/aes_128_gcm_12_decrypter_test.cc b/net/quic/crypto/aes_128_gcm_12_decrypter_test.cc
index 377d2b5d52ef6bbdbfe479bdca814c0a1945e05b..d55bab2544fe7d05caea8430411ea1d3dff4b5b3 100644
--- a/net/quic/crypto/aes_128_gcm_12_decrypter_test.cc
+++ b/net/quic/crypto/aes_128_gcm_12_decrypter_test.cc
@@ -263,7 +263,15 @@ QuicData* DecryptWithNonce(Aes128Gcm12Decrypter* decrypter,
decrypter->SetNoncePrefix(nonce_prefix);
memcpy(&sequence_number, nonce.data() + nonce_prefix.size(),
sizeof(sequence_number));
- return decrypter->DecryptPacket(sequence_number, associated_data, ciphertext);
+ scoped_ptr<char[]> output(new char[ciphertext.length()]);
+ size_t output_length = 0;
+ const bool success = decrypter->DecryptPacket(
+ sequence_number, associated_data, ciphertext, output.get(),
+ &output_length, ciphertext.length());
+ if (!success) {
+ return nullptr;
+ }
+ return new QuicData(output.release(), output_length, true);
}
TEST(Aes128Gcm12DecrypterTest, Decrypt) {
« no previous file with comments | « net/quic/crypto/aes_128_gcm_12_decrypter_nss.cc ('k') | net/quic/crypto/chacha20_poly1305_decrypter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698