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

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

Issue 1660593004: Landing Recent QUIC changes until 01/28/2016 18:41 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0202
Patch Set: Created 4 years, 11 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/aead_base_decrypter_nss.cc ('k') | net/quic/crypto/aead_base_encrypter_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/aead_base_decrypter_openssl.cc
diff --git a/net/quic/crypto/aead_base_decrypter_openssl.cc b/net/quic/crypto/aead_base_decrypter_openssl.cc
index 635a1705288bfcd1fca317794b5d68d2ad267291..512b80471db706e7f3bc427809a57c948915251a 100644
--- a/net/quic/crypto/aead_base_decrypter_openssl.cc
+++ b/net/quic/crypto/aead_base_decrypter_openssl.cc
@@ -9,6 +9,7 @@
#include "base/memory/scoped_ptr.h"
#include "net/quic/quic_flags.h"
+#include "net/quic/quic_utils.h"
using base::StringPiece;
@@ -93,15 +94,8 @@ bool AeadBaseDecrypter::DecryptPacket(QuicPathId path_id,
const size_t nonce_size = nonce_prefix_size_ + sizeof(packet_number);
memcpy(nonce, nonce_prefix_, nonce_prefix_size_);
if (FLAGS_quic_include_path_id_in_iv) {
- // Setting the nonce below relies on QuicPathId and QuicPacketNumber being
- // specific sizes.
- static_assert(sizeof(path_id) == 1, "Size of QuicPathId changed.");
- static_assert(sizeof(packet_number) == 8,
- "Size of QuicPacketNumber changed.");
- // Use path_id and lower 7 bytes of packet_number as lower 8 bytes of nonce.
uint64_t path_id_packet_number =
- (static_cast<uint64_t>(path_id) << 56) | packet_number;
- DCHECK(path_id != kDefaultPathId || path_id_packet_number == packet_number);
+ QuicUtils::PackPathIdAndPacketNumber(path_id, packet_number);
memcpy(nonce + nonce_prefix_size_, &path_id_packet_number,
sizeof(path_id_packet_number));
} else {
« no previous file with comments | « net/quic/crypto/aead_base_decrypter_nss.cc ('k') | net/quic/crypto/aead_base_encrypter_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698