diff --git a/quic/QuicConstants.h b/quic/QuicConstants.h index 52035e52b..a737e5464 100644 --- a/quic/QuicConstants.h +++ b/quic/QuicConstants.h @@ -395,4 +395,15 @@ inline std::ostream& operator<<(std::ostream& os, const QuicVersion& v) { */ std::vector filterSupportedVersions( const std::vector&); + +/** + * Represent the different encryption levels used by QUIC. + */ +enum class EncryptionLevel : uint8_t { + Initial, + Handshake, + EarlyData, + AppData, +}; + } // namespace quic diff --git a/quic/api/QuicPacketScheduler.cpp b/quic/api/QuicPacketScheduler.cpp index c2098d53d..d83f5c0d6 100644 --- a/quic/api/QuicPacketScheduler.cpp +++ b/quic/api/QuicPacketScheduler.cpp @@ -55,7 +55,7 @@ folly::Optional largestAckToSend(const AckState& ackState) { FrameScheduler::Builder::Builder( const QuicConnectionStateBase& conn, - fizz::EncryptionLevel encryptionLevel, + EncryptionLevel encryptionLevel, PacketNumberSpace packetNumberSpace, const std::string& name) : conn_(conn), diff --git a/quic/api/QuicPacketScheduler.h b/quic/api/QuicPacketScheduler.h index e013b9edf..7c456198e 100644 --- a/quic/api/QuicPacketScheduler.h +++ b/quic/api/QuicPacketScheduler.h @@ -316,7 +316,7 @@ class FrameScheduler : public QuicPacketScheduler { struct Builder { Builder( const QuicConnectionStateBase& conn, - fizz::EncryptionLevel encryptionLevel, + EncryptionLevel encryptionLevel, PacketNumberSpace packetNumberSpace, const std::string& name); @@ -333,7 +333,7 @@ class FrameScheduler : public QuicPacketScheduler { private: const QuicConnectionStateBase& conn_; - fizz::EncryptionLevel encryptionLevel_; + EncryptionLevel encryptionLevel_; PacketNumberSpace packetNumberSpace_; std::string name_; diff --git a/quic/api/QuicTransportFunctions.cpp b/quic/api/QuicTransportFunctions.cpp index 640090d5b..4ada1c202 100644 --- a/quic/api/QuicTransportFunctions.cpp +++ b/quic/api/QuicTransportFunctions.cpp @@ -491,7 +491,7 @@ uint64_t writeQuicDataToSocket( if (connection.pendingEvents.numProbePackets) { auto probeScheduler = std::move(FrameScheduler::Builder( connection, - fizz::EncryptionLevel::AppTraffic, + EncryptionLevel::AppData, PacketNumberSpace::AppData, "ProbeScheduler") .streamFrames() @@ -515,7 +515,7 @@ uint64_t writeQuicDataToSocket( } FrameScheduler scheduler = std::move(FrameScheduler::Builder( connection, - fizz::EncryptionLevel::AppTraffic, + EncryptionLevel::AppData, PacketNumberSpace::AppData, "FrameScheduler") .streamFrames() @@ -607,7 +607,7 @@ uint64_t writeQuicDataExceptCryptoStreamToSocket( if (connection.pendingEvents.numProbePackets) { auto probeScheduler = std::move(FrameScheduler::Builder( connection, - fizz::EncryptionLevel::AppTraffic, + EncryptionLevel::AppData, PacketNumberSpace::AppData, "ProbeWithoutCrypto") .streamFrames() @@ -630,7 +630,7 @@ uint64_t writeQuicDataExceptCryptoStreamToSocket( } FrameScheduler scheduler = std::move(FrameScheduler::Builder( connection, - fizz::EncryptionLevel::AppTraffic, + EncryptionLevel::AppData, PacketNumberSpace::AppData, "FrameSchedulerWithoutCrypto") .streamFrames() diff --git a/quic/api/test/QuicPacketSchedulerTest.cpp b/quic/api/test/QuicPacketSchedulerTest.cpp index 2eb1406d8..a4c336c8a 100644 --- a/quic/api/test/QuicPacketSchedulerTest.cpp +++ b/quic/api/test/QuicPacketSchedulerTest.cpp @@ -127,8 +127,7 @@ TEST_F(QuicPacketSchedulerTest, CryptoPaddingInitialPacket) { std::move(longHeader1), conn.ackStates.initialAckState.largestAckedByPeer); CryptoStreamScheduler scheduler( - conn, - *getCryptoStream(*conn.cryptoState, fizz::EncryptionLevel::Plaintext)); + conn, *getCryptoStream(*conn.cryptoState, EncryptionLevel::Initial)); writeDataToQuicStream( conn.cryptoState->initialStream, folly::IOBuf::copyBuffer("chlo")); scheduler.writeCryptoData(builder1); @@ -165,8 +164,7 @@ TEST_F(QuicPacketSchedulerTest, CryptoServerInitialNotPadded) { std::move(longHeader1), conn.ackStates.initialAckState.largestAckedByPeer); CryptoStreamScheduler scheduler( - conn, - *getCryptoStream(*conn.cryptoState, fizz::EncryptionLevel::Plaintext)); + conn, *getCryptoStream(*conn.cryptoState, EncryptionLevel::Initial)); writeDataToQuicStream( conn.cryptoState->initialStream, folly::IOBuf::copyBuffer("shlo")); scheduler.writeCryptoData(builder1); @@ -187,8 +185,7 @@ TEST_F(QuicPacketSchedulerTest, CryptoPaddingRetransmissionClientInitial) { std::move(longHeader), conn.ackStates.initialAckState.largestAckedByPeer); CryptoStreamScheduler scheduler( - conn, - *getCryptoStream(*conn.cryptoState, fizz::EncryptionLevel::Plaintext)); + conn, *getCryptoStream(*conn.cryptoState, EncryptionLevel::Initial)); conn.cryptoState->initialStream.lossBuffer.push_back( StreamBuffer{folly::IOBuf::copyBuffer("chlo"), 0, false}); scheduler.writeCryptoData(builder); @@ -210,8 +207,7 @@ TEST_F(QuicPacketSchedulerTest, CryptoSchedulerOnlySingleLossFits) { conn.ackStates.handshakeAckState.largestAckedByPeer); PacketBuilderWrapper builderWrapper(builder, 13); CryptoStreamScheduler scheduler( - conn, - *getCryptoStream(*conn.cryptoState, fizz::EncryptionLevel::Handshake)); + conn, *getCryptoStream(*conn.cryptoState, EncryptionLevel::Handshake)); conn.cryptoState->handshakeStream.lossBuffer.push_back( StreamBuffer{folly::IOBuf::copyBuffer("shlo"), 0, false}); conn.cryptoState->handshakeStream.lossBuffer.push_back(StreamBuffer{ @@ -236,8 +232,7 @@ TEST_F(QuicPacketSchedulerTest, CryptoWritePartialLossBuffer) { std::move(longHeader), conn.ackStates.initialAckState.largestAckedByPeer); CryptoStreamScheduler scheduler( - conn, - *getCryptoStream(*conn.cryptoState, fizz::EncryptionLevel::Plaintext)); + conn, *getCryptoStream(*conn.cryptoState, EncryptionLevel::Initial)); conn.cryptoState->initialStream.lossBuffer.push_back(StreamBuffer{ folly::IOBuf::copyBuffer("return the special duration value max"), 0, diff --git a/quic/api/test/QuicTransportFunctionsTest.cpp b/quic/api/test/QuicTransportFunctionsTest.cpp index bcbb8ade8..8e1a049af 100644 --- a/quic/api/test/QuicTransportFunctionsTest.cpp +++ b/quic/api/test/QuicTransportFunctionsTest.cpp @@ -35,7 +35,7 @@ uint64_t writeProbingDataToSocketForTest( QuicVersion version) { FrameScheduler scheduler = std::move(FrameScheduler::Builder( conn, - fizz::EncryptionLevel::AppTraffic, + EncryptionLevel::AppData, PacketNumberSpace::AppData, "test") .streamFrames() diff --git a/quic/client/QuicClientTransport.cpp b/quic/client/QuicClientTransport.cpp index be61ca294..3a1b6f462 100644 --- a/quic/client/QuicClientTransport.cpp +++ b/quic/client/QuicClientTransport.cpp @@ -698,11 +698,10 @@ void QuicClientTransport::writeData() { ? conn_->congestionController->getPacingRate(Clock::now()) : conn_->transportSettings.writeConnectionDataPacketsLimit); CryptoStreamScheduler initialScheduler( - *conn_, - *getCryptoStream(*conn_->cryptoState, fizz::EncryptionLevel::Plaintext)); + *conn_, *getCryptoStream(*conn_->cryptoState, EncryptionLevel::Initial)); CryptoStreamScheduler handshakeScheduler( *conn_, - *getCryptoStream(*conn_->cryptoState, fizz::EncryptionLevel::Handshake)); + *getCryptoStream(*conn_->cryptoState, EncryptionLevel::Handshake)); if (initialScheduler.hasData() || (conn_->ackStates.initialAckState.needsToSendAckImmediately && hasAcksToSchedule(conn_->ackStates.initialAckState))) { diff --git a/quic/client/handshake/ClientHandshake.cpp b/quic/client/handshake/ClientHandshake.cpp index ac20350e0..eca3df371 100644 --- a/quic/client/handshake/ClientHandshake.cpp +++ b/quic/client/handshake/ClientHandshake.cpp @@ -42,7 +42,7 @@ void ClientHandshake::connect( void ClientHandshake::doHandshake( std::unique_ptr data, - fizz::EncryptionLevel encryptionLevel) { + EncryptionLevel encryptionLevel) { if (!data) { return; } @@ -59,14 +59,14 @@ void ClientHandshake::doHandshake( // First add it to the right read buffer. switch (encryptionLevel) { - case fizz::EncryptionLevel::Plaintext: + case EncryptionLevel::Initial: initialReadBuf_.append(std::move(data)); break; - case fizz::EncryptionLevel::Handshake: + case EncryptionLevel::Handshake: handshakeReadBuf_.append(std::move(data)); break; - case fizz::EncryptionLevel::EarlyData: - case fizz::EncryptionLevel::AppTraffic: + case EncryptionLevel::EarlyData: + case EncryptionLevel::AppData: appDataReadBuf_.append(std::move(data)); break; } @@ -256,11 +256,12 @@ void ClientHandshake::ActionMoveVisitor::operator()( fizz::WriteToSocket& write) { for (auto& content : write.contents) { auto& cryptoState = client_.cryptoState_; - if (content.encryptionLevel == fizz::EncryptionLevel::AppTraffic) { + auto encryptionLevel = getEncryptionLevelFromFizz(content.encryptionLevel); + if (encryptionLevel == EncryptionLevel::AppData) { // Don't write 1-rtt handshake data on the client. continue; } - auto cryptoStream = getCryptoStream(cryptoState, content.encryptionLevel); + auto cryptoStream = getCryptoStream(cryptoState, encryptionLevel); writeDataToQuicStream(*cryptoStream, std::move(content.data)); } } diff --git a/quic/client/handshake/ClientHandshake.h b/quic/client/handshake/ClientHandshake.h index 18f45b485..1caf28ca5 100644 --- a/quic/client/handshake/ClientHandshake.h +++ b/quic/client/handshake/ClientHandshake.h @@ -59,7 +59,7 @@ class ClientHandshake : public Handshake { */ virtual void doHandshake( std::unique_ptr data, - fizz::EncryptionLevel encryptionLevel); + EncryptionLevel encryptionLevel); /** * An edge triggered API to get the oneRttWriteCipher. Once you receive the diff --git a/quic/client/handshake/test/ClientHandshakeTest.cpp b/quic/client/handshake/test/ClientHandshakeTest.cpp index 0db1ace56..29eb57cfb 100644 --- a/quic/client/handshake/test/ClientHandshakeTest.cpp +++ b/quic/client/handshake/test/ClientHandshakeTest.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -119,8 +120,9 @@ class ClientHandshakeTest : public Test, public boost::static_visitor<> { evb.loop(); for (auto& write : serverOutput) { for (auto& content : write.contents) { - handshake->doHandshake( - std::move(content.data), content.encryptionLevel); + auto encryptionLevel = + getEncryptionLevelFromFizz(content.encryptionLevel); + handshake->doHandshake(std::move(content.data), encryptionLevel); } } processHandshake(); diff --git a/quic/client/test/QuicClientTransportTest.cpp b/quic/client/test/QuicClientTransportTest.cpp index 7ae49c535..da5cff3a3 100644 --- a/quic/client/test/QuicClientTransportTest.cpp +++ b/quic/client/test/QuicClientTransportTest.cpp @@ -1010,8 +1010,7 @@ class FakeOneRttHandshakeLayer : public ClientHandshake { createServerTransportParameters(); } - void doHandshake(std::unique_ptr, fizz::EncryptionLevel) - override { + void doHandshake(std::unique_ptr, EncryptionLevel) override { EXPECT_EQ(writeBuf.get(), nullptr); if (getPhase() == Phase::Initial) { writeDataToQuicStream( diff --git a/quic/handshake/CMakeLists.txt b/quic/handshake/CMakeLists.txt index f60cde046..0c2f10d5b 100644 --- a/quic/handshake/CMakeLists.txt +++ b/quic/handshake/CMakeLists.txt @@ -5,6 +5,7 @@ add_library( mvfst_handshake STATIC + FizzBridge.cpp HandshakeLayer.cpp QuicFizzFactory.cpp TransportParameters.cpp diff --git a/quic/handshake/FizzBridge.cpp b/quic/handshake/FizzBridge.cpp new file mode 100644 index 000000000..24a20921a --- /dev/null +++ b/quic/handshake/FizzBridge.cpp @@ -0,0 +1,29 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +#include + +namespace quic { + +EncryptionLevel getEncryptionLevelFromFizz( + const fizz::EncryptionLevel encryptionLevel) { + switch (encryptionLevel) { + case fizz::EncryptionLevel::Plaintext: + return EncryptionLevel::Initial; + case fizz::EncryptionLevel::Handshake: + return EncryptionLevel::Handshake; + case fizz::EncryptionLevel::EarlyData: + return EncryptionLevel::EarlyData; + case fizz::EncryptionLevel::AppTraffic: + return EncryptionLevel::AppData; + } + + folly::assume_unreachable(); +} + +} // namespace quic diff --git a/quic/handshake/FizzBridge.h b/quic/handshake/FizzBridge.h index 617ae109e..b6ec57826 100644 --- a/quic/handshake/FizzBridge.h +++ b/quic/handshake/FizzBridge.h @@ -9,6 +9,8 @@ #pragma once #include +#include +#include #include #include @@ -63,4 +65,7 @@ class FizzAead final : public Aead { : fizzAead(std::move(fizzAeadIn)) {} }; +EncryptionLevel getEncryptionLevelFromFizz( + const fizz::EncryptionLevel encryptionLevel); + } // namespace quic diff --git a/quic/handshake/HandshakeLayer.cpp b/quic/handshake/HandshakeLayer.cpp index d066dc694..d11c0ac9e 100644 --- a/quic/handshake/HandshakeLayer.cpp +++ b/quic/handshake/HandshakeLayer.cpp @@ -117,17 +117,17 @@ std::unique_ptr makePacketNumberCipher( return pnCipher; } -fizz::EncryptionLevel protectionTypeToEncryptionLevel(ProtectionType type) { +EncryptionLevel protectionTypeToEncryptionLevel(ProtectionType type) { switch (type) { case ProtectionType::Initial: - return fizz::EncryptionLevel::Plaintext; + return EncryptionLevel::Initial; case ProtectionType::Handshake: - return fizz::EncryptionLevel::Handshake; + return EncryptionLevel::Handshake; case ProtectionType::ZeroRtt: - return fizz::EncryptionLevel::EarlyData; + return EncryptionLevel::EarlyData; case ProtectionType::KeyPhaseZero: case ProtectionType::KeyPhaseOne: - return fizz::EncryptionLevel::AppTraffic; + return EncryptionLevel::AppData; } folly::assume_unreachable(); } diff --git a/quic/handshake/HandshakeLayer.h b/quic/handshake/HandshakeLayer.h index 1bb93653f..6ec17a480 100644 --- a/quic/handshake/HandshakeLayer.h +++ b/quic/handshake/HandshakeLayer.h @@ -10,8 +10,6 @@ #include #include -#include -#include #include #include @@ -91,7 +89,7 @@ std::unique_ptr makePacketNumberCipher( fizz::CipherSuite cipher); /** - * Converts the protection type of QUIC to the encryption type of fizz. + * Converts the protection type of QUIC to an encryption level. */ -fizz::EncryptionLevel protectionTypeToEncryptionLevel(ProtectionType type); +EncryptionLevel protectionTypeToEncryptionLevel(ProtectionType type); } // namespace quic diff --git a/quic/server/QuicServerTransport.cpp b/quic/server/QuicServerTransport.cpp index aaa0ce297..3dc74a682 100644 --- a/quic/server/QuicServerTransport.cpp +++ b/quic/server/QuicServerTransport.cpp @@ -189,11 +189,10 @@ void QuicServerTransport::writeData() { ? conn_->congestionController->getPacingRate(Clock::now()) : conn_->transportSettings.writeConnectionDataPacketsLimit); CryptoStreamScheduler initialScheduler( - *conn_, - *getCryptoStream(*conn_->cryptoState, fizz::EncryptionLevel::Plaintext)); + *conn_, *getCryptoStream(*conn_->cryptoState, EncryptionLevel::Initial)); CryptoStreamScheduler handshakeScheduler( *conn_, - *getCryptoStream(*conn_->cryptoState, fizz::EncryptionLevel::Handshake)); + *getCryptoStream(*conn_->cryptoState, EncryptionLevel::Handshake)); if (initialScheduler.hasData() || (conn_->ackStates.initialAckState.needsToSendAckImmediately && hasAcksToSchedule(conn_->ackStates.initialAckState))) { diff --git a/quic/server/handshake/AppToken.h b/quic/server/handshake/AppToken.h index d0bfe63cb..3c3325597 100644 --- a/quic/server/handshake/AppToken.h +++ b/quic/server/handshake/AppToken.h @@ -11,7 +11,6 @@ #include #include -#include #include #include #include diff --git a/quic/server/handshake/ServerHandshake.cpp b/quic/server/handshake/ServerHandshake.cpp index fba6e2a5b..f754da139 100644 --- a/quic/server/handshake/ServerHandshake.cpp +++ b/quic/server/handshake/ServerHandshake.cpp @@ -51,21 +51,21 @@ void ServerHandshake::initialize( void ServerHandshake::doHandshake( std::unique_ptr data, - fizz::EncryptionLevel encryptionLevel) { + EncryptionLevel encryptionLevel) { SCOPE_EXIT { inHandshakeStack_ = false; }; inHandshakeStack_ = true; waitForData_ = false; switch (encryptionLevel) { - case fizz::EncryptionLevel::Plaintext: + case EncryptionLevel::Initial: initialReadBuf_.append(std::move(data)); break; - case fizz::EncryptionLevel::Handshake: + case EncryptionLevel::Handshake: handshakeReadBuf_.append(std::move(data)); break; - case fizz::EncryptionLevel::EarlyData: - case fizz::EncryptionLevel::AppTraffic: + case EncryptionLevel::EarlyData: + case EncryptionLevel::AppData: appDataReadBuf_.append(std::move(data)); break; } @@ -213,12 +213,13 @@ void ServerHandshake::onWriteData(fizz::WriteToSocket& write) { return; } for (auto& content : write.contents) { - CHECK(content.encryptionLevel != fizz::EncryptionLevel::EarlyData) + auto encryptionLevel = getEncryptionLevelFromFizz(content.encryptionLevel); + CHECK(encryptionLevel != EncryptionLevel::EarlyData) << "Server cannot write early data"; if (content.contentType != fizz::ContentType::handshake) { continue; } - auto cryptoStream = getCryptoStream(cryptoState_, content.encryptionLevel); + auto cryptoStream = getCryptoStream(cryptoState_, encryptionLevel); writeDataToQuicStream(*cryptoStream, std::move(content.data)); } handshakeEventAvailable_ = true; diff --git a/quic/server/handshake/ServerHandshake.h b/quic/server/handshake/ServerHandshake.h index 388df8962..51ebd0dda 100644 --- a/quic/server/handshake/ServerHandshake.h +++ b/quic/server/handshake/ServerHandshake.h @@ -94,7 +94,7 @@ class ServerHandshake : public Handshake { */ virtual void doHandshake( std::unique_ptr data, - fizz::EncryptionLevel encryptionLevel); + EncryptionLevel encryptionLevel); /** * Writes a session ticket on the connection. diff --git a/quic/server/handshake/test/ServerHandshakeTest.cpp b/quic/server/handshake/test/ServerHandshakeTest.cpp index 4c4de75fd..1946fac55 100644 --- a/quic/server/handshake/test/ServerHandshakeTest.cpp +++ b/quic/server/handshake/test/ServerHandshakeTest.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -163,8 +164,9 @@ class ServerHandshakeTest : public Test { try { for (auto& clientWrite : clientWrites) { for (auto& content : clientWrite.contents) { - handshake->doHandshake( - std::move(content.data), content.encryptionLevel); + auto encryptionLevel = + getEncryptionLevelFromFizz(content.encryptionLevel); + handshake->doHandshake(std::move(content.data), encryptionLevel); } } setHandshakeState(); diff --git a/quic/server/test/QuicServerTransportTest.cpp b/quic/server/test/QuicServerTransportTest.cpp index b9aedcd3c..a6052991a 100644 --- a/quic/server/test/QuicServerTransportTest.cpp +++ b/quic/server/test/QuicServerTransportTest.cpp @@ -47,8 +47,7 @@ class FakeServerHandshake : public ServerHandshake { MOCK_METHOD1(writeNewSessionTicket, void(const AppToken&)); - void doHandshake(std::unique_ptr data, fizz::EncryptionLevel) - override { + void doHandshake(std::unique_ptr data, EncryptionLevel) override { IOBufEqualTo eq; auto chlo = folly::IOBuf::copyBuffer("CHLO"); auto clientFinished = IOBuf::copyBuffer("FINISHED"); @@ -57,8 +56,7 @@ class FakeServerHandshake : public ServerHandshake { // Do NOT invoke onCryptoEventAvailable callback // Fall through and let the ServerStateMachine to process the event writeDataToQuicStream( - *getCryptoStream( - *conn_.cryptoState, fizz::EncryptionLevel::Plaintext), + *getCryptoStream(*conn_.cryptoState, EncryptionLevel::Initial), IOBuf::copyBuffer("SHLO")); if (allowZeroRttKeys_) { validateAndUpdateSourceToken(conn_, sourceAddrs_); @@ -70,8 +68,7 @@ class FakeServerHandshake : public ServerHandshake { // Asynchronously schedule the callback executor_->add([&] { writeDataToQuicStream( - *getCryptoStream( - *conn_.cryptoState, fizz::EncryptionLevel::Plaintext), + *getCryptoStream(*conn_.cryptoState, EncryptionLevel::Initial), IOBuf::copyBuffer("SHLO")); if (allowZeroRttKeys_) { validateAndUpdateSourceToken(conn_, sourceAddrs_); @@ -382,7 +379,7 @@ class QuicServerTransportTest : public Test { auto headerCipher = test::createNoOpHeaderCipher(); uint64_t offset = getCryptoStream( - *server->getConn().cryptoState, fizz::EncryptionLevel::Handshake) + *server->getConn().cryptoState, EncryptionLevel::Handshake) ->currentReadOffset; auto handshakeCipher = test::createNoOpAead(); auto finishedPacket = packetToBufCleartext( @@ -468,10 +465,9 @@ class QuicServerTransportTest : public Test { EXPECT_NE(server->getConn().oneRttWriteHeaderCipher, nullptr); EXPECT_NE(server->getConn().readCodec->getOneRttHeaderCipher(), nullptr); - EXPECT_TRUE( - getCryptoStream( - *server->getConn().cryptoState, fizz::EncryptionLevel::Plaintext) - ->readBuffer.empty()); + EXPECT_TRUE(getCryptoStream( + *server->getConn().cryptoState, EncryptionLevel::Initial) + ->readBuffer.empty()); EXPECT_NE(server->getConn().initialWriteCipher, nullptr); EXPECT_FALSE(server->getConn().localConnectionError.hasValue()); verifyTransportParameters(kDefaultIdleTimeout); diff --git a/quic/state/QuicStreamFunctions.cpp b/quic/state/QuicStreamFunctions.cpp index 5708e3d0d..ded62fd42 100644 --- a/quic/state/QuicStreamFunctions.cpp +++ b/quic/state/QuicStreamFunctions.cpp @@ -396,17 +396,17 @@ void cancelHandshakeCryptoStreamRetransmissions(QuicCryptoState& cryptoState) { QuicCryptoStream* getCryptoStream( QuicCryptoState& cryptoState, - fizz::EncryptionLevel encryptionLevel) { + EncryptionLevel encryptionLevel) { switch (encryptionLevel) { - case fizz::EncryptionLevel::Plaintext: + case EncryptionLevel::Initial: return &cryptoState.initialStream; - case fizz::EncryptionLevel::Handshake: + case EncryptionLevel::Handshake: return &cryptoState.handshakeStream; - case fizz::EncryptionLevel::EarlyData: + case EncryptionLevel::EarlyData: // TODO: remove this when we implement EOED for // draft-17. return &cryptoState.handshakeStream; - case fizz::EncryptionLevel::AppTraffic: + case EncryptionLevel::AppData: return &cryptoState.oneRttStream; } folly::assume_unreachable(); diff --git a/quic/state/QuicStreamFunctions.h b/quic/state/QuicStreamFunctions.h index 006a09eee..bb7429b58 100644 --- a/quic/state/QuicStreamFunctions.h +++ b/quic/state/QuicStreamFunctions.h @@ -129,7 +129,7 @@ void cancelHandshakeCryptoStreamRetransmissions(QuicCryptoState& cryptoStream); */ QuicCryptoStream* getCryptoStream( QuicCryptoState& cryptoState, - fizz::EncryptionLevel encryptionLevel); + EncryptionLevel encryptionLevel); void processCryptoStreamAck( QuicCryptoStream& cryptoStream,