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

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

Issue 14816006: Land Recent QUIC changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added missing NET_PRIVATE_EXPORT to QuicWallTime Created 7 years, 7 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/congestion_control/tcp_cubic_sender_test.cc ('k') | net/quic/crypto/aes_128_gcm_decrypter_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/aes_128_gcm_decrypter_openssl.cc
diff --git a/net/quic/crypto/aes_128_gcm_decrypter_openssl.cc b/net/quic/crypto/aes_128_gcm_decrypter_openssl.cc
index 105ae8c8bb570a67c9b0852eed20696942fd8134..0800cb5ed7f579d0b054ebf32b855ce07cd6459f 100644
--- a/net/quic/crypto/aes_128_gcm_decrypter_openssl.cc
+++ b/net/quic/crypto/aes_128_gcm_decrypter_openssl.cc
@@ -21,13 +21,10 @@ const size_t kAuthTagSize = 16;
} // namespace
-Aes128GcmDecrypter::Aes128GcmDecrypter() {
-}
+Aes128GcmDecrypter::Aes128GcmDecrypter() {}
// static
-bool Aes128GcmDecrypter::IsSupported() {
- return true;
-}
+bool Aes128GcmDecrypter::IsSupported() { return true; }
bool Aes128GcmDecrypter::SetKey(StringPiece key) {
DCHECK_EQ(key.size(), sizeof(key_));
@@ -63,8 +60,7 @@ bool Aes128GcmDecrypter::Decrypt(StringPiece nonce,
ScopedEVPCipherCtx ctx;
// Set the cipher type and the key. The IV (nonce) is set below.
- if (EVP_DecryptInit_ex(ctx.get(), EVP_aes_128_gcm(), NULL, key_,
- NULL) == 0) {
+ if (EVP_DecryptInit_ex(ctx.get(), EVP_aes_128_gcm(), NULL, key_, NULL) == 0) {
return false;
}
@@ -74,16 +70,16 @@ bool Aes128GcmDecrypter::Decrypt(StringPiece nonce,
return false;
}
// Set the IV (nonce).
- if (EVP_DecryptInit_ex(ctx.get(), NULL, NULL, NULL,
- reinterpret_cast<const unsigned char*>(
- nonce.data())) == 0) {
+ if (EVP_DecryptInit_ex(
+ ctx.get(), NULL, NULL, NULL,
+ reinterpret_cast<const unsigned char*>(nonce.data())) == 0) {
return false;
}
// Set the authentication tag.
- if (EVP_CIPHER_CTX_ctrl(ctx.get(), EVP_CTRL_GCM_SET_TAG, kAuthTagSize,
- const_cast<char*>(ciphertext.data()) +
- plaintext_size) == 0) {
+ if (EVP_CIPHER_CTX_ctrl(
+ ctx.get(), EVP_CTRL_GCM_SET_TAG, kAuthTagSize,
+ const_cast<char*>(ciphertext.data()) + plaintext_size) == 0) {
return false;
}
@@ -92,18 +88,18 @@ bool Aes128GcmDecrypter::Decrypt(StringPiece nonce,
if (!associated_data.empty()) {
// Set the associated data. The second argument (output buffer) must be
// NULL.
- if (EVP_DecryptUpdate(ctx.get(), NULL, &len,
- reinterpret_cast<const unsigned char*>(
- associated_data.data()),
- associated_data.size()) == 0) {
+ if (EVP_DecryptUpdate(
+ ctx.get(), NULL, &len,
+ reinterpret_cast<const unsigned char*>(associated_data.data()),
+ associated_data.size()) == 0) {
return false;
}
}
- if (EVP_DecryptUpdate(ctx.get(), output, &len,
- reinterpret_cast<const unsigned char*>(
- ciphertext.data()),
- plaintext_size) == 0) {
+ if (EVP_DecryptUpdate(
+ ctx.get(), output, &len,
+ reinterpret_cast<const unsigned char*>(ciphertext.data()),
+ plaintext_size) == 0) {
return false;
}
output += len;
« no previous file with comments | « net/quic/congestion_control/tcp_cubic_sender_test.cc ('k') | net/quic/crypto/aes_128_gcm_decrypter_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698