Unconditionally call CryptoUtils::CreateInitialObfuscators
gfe-relnote: refactor how CryptoUtils::CreateInitialObfuscators gets called, no behavior change
PiperOrigin-RevId: 268972396
Change-Id: Ie3dfa509138d0b756dbd239dadc6cad68545ed6f
diff --git a/quic/core/chlo_extractor.cc b/quic/core/chlo_extractor.cc
index 1cf6e14..0430f8d 100644
--- a/quic/core/chlo_extractor.cc
+++ b/quic/core/chlo_extractor.cc
@@ -120,22 +120,10 @@
const QuicPacketHeader& header) {
connection_id_ = header.destination_connection_id;
// QuicFramer creates a NullEncrypter and NullDecrypter at level
- // ENCRYPTION_INITIAL, which are the correct ones to use with the QUIC Crypto
- // handshake. When the TLS handshake is used, the IETF-style initial crypters
- // are used instead, so those need to be created and installed.
- if (header.version.handshake_protocol == PROTOCOL_TLS1_3) {
- CrypterPair crypters;
- CryptoUtils::CreateInitialObfuscators(
- Perspective::IS_SERVER, header.version,
- header.destination_connection_id, &crypters);
- framer_->SetEncrypter(ENCRYPTION_INITIAL, std::move(crypters.encrypter));
- if (framer_->version().KnowsWhichDecrypterToUse()) {
- framer_->InstallDecrypter(ENCRYPTION_INITIAL,
- std::move(crypters.decrypter));
- } else {
- framer_->SetDecrypter(ENCRYPTION_INITIAL, std::move(crypters.decrypter));
- }
- }
+ // ENCRYPTION_INITIAL. While those are the correct ones to use with some
+ // versions of QUIC, others use the IETF-style initial crypters, so those need
+ // to be created and installed.
+ framer_->SetInitialObfuscators(header.destination_connection_id);
return true;
}
bool ChloFramerVisitor::OnUnauthenticatedHeader(