mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 04:07:35 +03:00
process the NewSessionTicket TLS message
This commit is contained in:
parent
da4b3e3176
commit
2adf923ee6
6 changed files with 32 additions and 14 deletions
|
@ -18,13 +18,15 @@ var _ = Describe("Crypto Stream Manager", func() {
|
|||
|
||||
initialStream *MockCryptoStream
|
||||
handshakeStream *MockCryptoStream
|
||||
oneRTTStream *MockCryptoStream
|
||||
)
|
||||
|
||||
BeforeEach(func() {
|
||||
initialStream = NewMockCryptoStream(mockCtrl)
|
||||
handshakeStream = NewMockCryptoStream(mockCtrl)
|
||||
oneRTTStream = NewMockCryptoStream(mockCtrl)
|
||||
cs = NewMockCryptoDataHandler(mockCtrl)
|
||||
csm = newCryptoStreamManager(cs, initialStream, handshakeStream)
|
||||
csm = newCryptoStreamManager(cs, initialStream, handshakeStream, oneRTTStream)
|
||||
})
|
||||
|
||||
It("passes messages to the initial stream", func() {
|
||||
|
@ -49,6 +51,17 @@ var _ = Describe("Crypto Stream Manager", func() {
|
|||
Expect(encLevelChanged).To(BeFalse())
|
||||
})
|
||||
|
||||
It("passes messages to the 1-RTT stream", func() {
|
||||
cf := &wire.CryptoFrame{Data: []byte("foobar")}
|
||||
oneRTTStream.EXPECT().HandleCryptoFrame(cf)
|
||||
oneRTTStream.EXPECT().GetCryptoData().Return([]byte("foobar"))
|
||||
oneRTTStream.EXPECT().GetCryptoData()
|
||||
cs.EXPECT().HandleMessage([]byte("foobar"), protocol.Encryption1RTT)
|
||||
encLevelChanged, err := csm.HandleCryptoFrame(cf, protocol.Encryption1RTT)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(encLevelChanged).To(BeFalse())
|
||||
})
|
||||
|
||||
It("doesn't call the message handler, if there's no message", func() {
|
||||
cf := &wire.CryptoFrame{Data: []byte("foobar")}
|
||||
handshakeStream.EXPECT().HandleCryptoFrame(cf)
|
||||
|
@ -98,12 +111,6 @@ var _ = Describe("Crypto Stream Manager", func() {
|
|||
Expect(err).To(MatchError(err))
|
||||
})
|
||||
|
||||
It("ignores post-handshake crypto data", func() {
|
||||
changed, err := csm.HandleCryptoFrame(&wire.CryptoFrame{}, protocol.Encryption1RTT)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(changed).To(BeFalse())
|
||||
})
|
||||
|
||||
It("errors for unknown encryption levels", func() {
|
||||
_, err := csm.HandleCryptoFrame(&wire.CryptoFrame{}, 42)
|
||||
Expect(err).To(HaveOccurred())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue