Skip to content

Commit

Permalink
Unconditionally defer control of writing session tickets to quic layer.
Browse files Browse the repository at this point in the history
Summary: There is no reason to let the TLS layer control this.

Reviewed By: jbeshay

Differential Revision: D51267586

fbshipit-source-id: 6f70b7f6ba51a9a022195f7e2c1683b5323fde7a
  • Loading branch information
Kyle Nekritz authored and facebook-github-bot committed Nov 30, 2023
1 parent e6085c0 commit 8c68b18
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion quic/fizz/server/handshake/FizzServerHandshake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ void FizzServerHandshake::initializeImpl(
context->setFactory(cryptoFactory_->getFizzFactory());
context->setSupportedCiphers({{fizz::CipherSuite::TLS_AES_128_GCM_SHA256}});
context->setVersionFallbackEnabled(false);
// Since Draft-17, client won't sent EOED
context->setOmitEarlyRecordLayer(true);
context->setSendNewSessionTicket(false);
state_.context() = std::move(context);
callback_ = callback;

Expand Down
2 changes: 1 addition & 1 deletion quic/server/QuicServerTransport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ bool QuicServerTransport::shouldWriteNewSessionTicket() {
}

void QuicServerTransport::maybeWriteNewSessionTicket() {
if (shouldWriteNewSessionTicket() && !ctx_->getSendNewSessionTicket() &&
if (shouldWriteNewSessionTicket() &&
serverConn_->serverHandshakeLayer->isHandshakeDone()) {
if (conn_->qLogger) {
conn_->qLogger->addTransportStateUpdate(kWriteNst);
Expand Down
9 changes: 5 additions & 4 deletions quic/server/test/QuicServerTransportTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4043,13 +4043,14 @@ TEST_F(

std::vector<int> indices =
getQLogEventIndices(QLogEventType::TransportStateUpdate, qLogger);
EXPECT_EQ(indices.size(), 4);
std::array<::std::string, 4> updateArray = {
EXPECT_EQ(indices.size(), 5);
std::array<::std::string, 5> updateArray = {
kDerivedZeroRttReadCipher,
kDerivedOneRttWriteCipher,
kTransportReady,
kDerivedOneRttReadCipher};
for (int i = 0; i < 4; ++i) {
kDerivedOneRttReadCipher,
kWriteNst};
for (int i = 0; i < 5; ++i) {
auto tmp = std::move(qLogger->logs[indices[i]]);
auto event = dynamic_cast<QLogTransportStateUpdateEvent*>(tmp.get());
EXPECT_EQ(event->update, updateArray[i]);
Expand Down
8 changes: 2 additions & 6 deletions quic/server/test/QuicServerTransportTestUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,9 @@ class QuicServerTransportTestBase : public virtual testing::Test {
virtual void expectWriteNewSessionTicket() {
server->setEarlyDataAppParamsFunctions(
[](const folly::Optional<std::string>&, const Buf&) { return false; },
[]() -> Buf {
// This function shouldn't be called
EXPECT_TRUE(false);
return nullptr;
});
[]() -> Buf { return nullptr; });
EXPECT_CALL(*getFakeHandshakeLayer(), writeNewSessionTicket(testing::_))
.Times(0);
.Times(1);
}

virtual void setupConnection() {
Expand Down

0 comments on commit 8c68b18

Please sign in to comment.