Skip to content

Commit

Permalink
quic: don't send session tickets
Browse files Browse the repository at this point in the history
The crypto/tls QUIC session ticket API may change prior to the
go1.21 release (see golang/go#60107). Drop session tickets
entirely for now. We can revisit this when adding 0-RTT support
later, which will also need to interact with session tickets.

For golang/go#58547

Change-Id: Ib24c456508e39ed11fa284ca3832ba61dc5121f3
Reviewed-on: https://go-review.googlesource.com/c/net/+/514999
Run-TryBot: Damien Neil <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Roland Shoemaker <[email protected]>
  • Loading branch information
neild committed Aug 2, 2023
1 parent a7da556 commit 60ae793
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 21 deletions.
4 changes: 1 addition & 3 deletions internal/quic/conn_id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,7 @@ func TestConnIDPeerWithZeroLengthConnIDSendsNewConnectionID(t *testing.T) {
// An endpoint that selects a zero-length connection ID during the handshake
// cannot issue a new connection ID."
// https://www.rfc-editor.org/rfc/rfc9000#section-5.1.1-8
tc := newTestConn(t, clientSide, func(c *tls.Config) {
c.SessionTicketsDisabled = true
})
tc := newTestConn(t, clientSide)
tc.peerConnID = []byte{}
tc.ignoreFrame(frameTypeAck)
tc.uncheckedHandshake()
Expand Down
8 changes: 0 additions & 8 deletions internal/quic/conn_loss_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,9 @@ func TestLostHandshakeDoneFrame(t *testing.T) {

tc.wantFrame("server sends HANDSHAKE_DONE after handshake completes",
packetType1RTT, debugFrameHandshakeDone{})
tc.wantFrame("server sends session ticket in CRYPTO frame",
packetType1RTT, debugFrameCrypto{
data: tc.cryptoDataOut[tls.QUICEncryptionLevelApplication],
})

tc.triggerLossOrPTO(packetType1RTT, pto)
tc.wantFrame("server resends HANDSHAKE_DONE",
packetType1RTT, debugFrameHandshakeDone{})
tc.wantFrame("server resends session ticket",
packetType1RTT, debugFrameCrypto{
data: tc.cryptoDataOut[tls.QUICEncryptionLevelApplication],
})
})
}
5 changes: 0 additions & 5 deletions internal/quic/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ func (c *Conn) handleTLSEvents(now time.Time) error {
// at the server when the handshake completes."
// https://www.rfc-editor.org/rfc/rfc9001#section-4.1.2-1
c.confirmHandshake(now)
if !c.config.TLSConfig.SessionTicketsDisabled {
if err := c.tls.SendSessionTicket(false); err != nil {
return err
}
}
}
case tls.QUICTransportParameters:
params, err := unmarshalTransportParams(e.Data)
Expand Down
7 changes: 2 additions & 5 deletions internal/quic/tls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func handshakeDatagrams(tc *testConn) (dgrams []*testDatagram) {
}},
paddedSize: 1200,
}, {
// Server HANDSHAKE_DONE and session ticket
// Server HANDSHAKE_DONE
packets: []*testPacket{{
ptype: packetType1RTT,
num: 1,
Expand All @@ -182,7 +182,6 @@ func handshakeDatagrams(tc *testConn) (dgrams []*testDatagram) {
ranges: []i64range[packetNumber]{{0, 1}},
},
debugFrameHandshakeDone{},
debugFrameCrypto{},
},
}},
}, {
Expand Down Expand Up @@ -351,9 +350,7 @@ func TestConnKeysDiscardedClient(t *testing.T) {
}

func TestConnKeysDiscardedServer(t *testing.T) {
tc := newTestConn(t, serverSide, func(c *tls.Config) {
c.SessionTicketsDisabled = true
})
tc := newTestConn(t, serverSide)
tc.ignoreFrame(frameTypeAck)

tc.writeFrames(packetTypeInitial,
Expand Down

0 comments on commit 60ae793

Please sign in to comment.