diff --git a/crypto_stream_manager.go b/crypto_stream_manager.go index 330b26da..64e78781 100644 --- a/crypto_stream_manager.go +++ b/crypto_stream_manager.go @@ -37,6 +37,9 @@ func (m *cryptoStreamManager) HandleCryptoFrame(frame *wire.CryptoFrame, encLeve str = m.initialStream case protocol.EncryptionHandshake: str = m.handshakeStream + case protocol.Encryption1RTT: + // TODO(#981): process session tickets + return false, nil default: return false, fmt.Errorf("received CRYPTO frame with unexpected encryption level: %s", encLevel) } diff --git a/crypto_stream_manager_test.go b/crypto_stream_manager_test.go index b57a0299..0c331cb4 100644 --- a/crypto_stream_manager_test.go +++ b/crypto_stream_manager_test.go @@ -98,8 +98,15 @@ 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{}, protocol.Encryption1RTT) - Expect(err).To(MatchError("received CRYPTO frame with unexpected encryption level: 1-RTT")) + _, err := csm.HandleCryptoFrame(&wire.CryptoFrame{}, 42) + Expect(err).To(HaveOccurred()) + Expect(err.Error()).To(ContainSubstring("received CRYPTO frame with unexpected encryption level")) }) })