use the same packet number space for received 0-RTT and 1-RTT packets

This commit is contained in:
Marten Seemann 2019-06-23 13:52:42 +08:00
parent b25b2f6921
commit d6b50cf15a
2 changed files with 19 additions and 7 deletions

View file

@ -48,6 +48,16 @@ var _ = Describe("Received Packet Handler", func() {
Expect(oneRTTAck.DelayTime).To(BeNumerically("~", time.Second, 50*time.Millisecond))
})
It("uses the same packet number space for 0-RTT and 1-RTT packets", func() {
sendTime := time.Now().Add(-time.Second)
handler.ReceivedPacket(2, protocol.Encryption0RTT, sendTime, true)
handler.ReceivedPacket(3, protocol.Encryption1RTT, sendTime, true)
ack := handler.GetAckFrame(protocol.Encryption1RTT)
Expect(ack).ToNot(BeNil())
Expect(ack.AckRanges).To(HaveLen(1))
Expect(ack.AckRanges[0]).To(Equal(wire.AckRange{Smallest: 2, Largest: 3}))
})
It("drops Initial packets", func() {
sendTime := time.Now().Add(-time.Second)
handler.ReceivedPacket(2, protocol.EncryptionInitial, sendTime, true)