Merge pull request #1177 from lucas-clemente/transport-parameters-new-sesssion-ticket

don't accept transport parameters in the NewSessionTicket message
This commit is contained in:
Marten Seemann 2018-02-18 14:03:31 +08:00 committed by GitHub
commit 86b25dddce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 14 deletions

View file

@ -66,17 +66,12 @@ func (h *extensionHandlerClient) Receive(hType mint.HandshakeType, el *mint.Exte
return err return err
} }
if hType != mint.HandshakeTypeEncryptedExtensions && hType != mint.HandshakeTypeNewSessionTicket { if hType != mint.HandshakeTypeEncryptedExtensions {
if found { if found {
return fmt.Errorf("Unexpected QUIC extension in handshake message %d", hType) return fmt.Errorf("Unexpected QUIC extension in handshake message %d", hType)
} }
return nil return nil
} }
if hType == mint.HandshakeTypeNewSessionTicket {
// the extension it's optional in the NewSessionTicket message
// TODO: handle this
return nil
}
// hType == mint.HandshakeTypeEncryptedExtensions // hType == mint.HandshakeTypeEncryptedExtensions
if !found { if !found {

View file

@ -120,14 +120,6 @@ var _ = Describe("TLS Extension Handler, for the client", func() {
Expect(err).ToNot(HaveOccurred()) Expect(err).ToNot(HaveOccurred())
}) })
// TODO: fix this when implementing the NewSessionTicket
It("ignors the TransportParameters in the NewSessionTicket message", func() {
err := el.Add(fakeBody)
Expect(err).ToNot(HaveOccurred())
err = handler.Receive(mint.HandshakeTypeNewSessionTicket, &el)
Expect(err).ToNot(HaveOccurred())
})
It("errors when it can't parse the TransportParameters", func() { It("errors when it can't parse the TransportParameters", func() {
err := el.Add(fakeBody) err := el.Add(fakeBody)
Expect(err).ToNot(HaveOccurred()) Expect(err).ToNot(HaveOccurred())