use stream 0 for the crypto stream when using TLS

This commit is contained in:
Marten Seemann
2017-11-01 13:51:47 +07:00
parent 05f6e1cf8e
commit f662822486
16 changed files with 93 additions and 59 deletions

View File

@@ -55,7 +55,7 @@ func (u *packetUnpacker) Unpack(headerBinary []byte, hdr *wire.Header, data []by
err = qerr.Error(qerr.InvalidStreamData, err.Error())
} else {
streamID := frame.(*wire.StreamFrame).StreamID
if streamID != 1 && encryptionLevel <= protocol.EncryptionUnencrypted {
if streamID != u.version.CryptoStreamID() && encryptionLevel <= protocol.EncryptionUnencrypted {
err = qerr.Error(qerr.UnencryptedStreamData, fmt.Sprintf("received unencrypted stream data on stream %d", streamID))
}
}