check if a frame is allowed at the encryption level it was sent with

This commit is contained in:
Marten Seemann
2019-06-29 12:32:19 +07:00
parent 4fe0f6752c
commit 299da56aef
4 changed files with 134 additions and 61 deletions

View File

@@ -818,10 +818,6 @@ func (s *session) handleCryptoFrame(frame *wire.CryptoFrame, encLevel protocol.E
}
func (s *session) handleStreamFrame(frame *wire.StreamFrame, encLevel protocol.EncryptionLevel) error {
// TODO(#1261): implement strict rules for frames types in unencrypted packets
if encLevel < protocol.Encryption1RTT {
return qerr.Error(qerr.ProtocolViolation, fmt.Sprintf("received unencrypted stream data on stream %d", frame.StreamID))
}
str, err := s.streamsMap.GetOrOpenReceiveStream(frame.StreamID)
if err != nil {
return err