forked from quic-go/quic-go
move the unencrypted STREAM frame check from the unpacker to the session
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/bifurcation/mint"
|
||||
@@ -123,6 +124,9 @@ func unpackInitialPacket(aead crypto.AEAD, hdr *wire.Header, data []byte, versio
|
||||
if frame == nil {
|
||||
return nil, errors.New("Packet doesn't contain a STREAM_FRAME")
|
||||
}
|
||||
if frame.StreamID != version.CryptoStreamID() {
|
||||
return nil, fmt.Errorf("Received STREAM_FRAME for wrong stream (Stream ID %d)", frame.StreamID)
|
||||
}
|
||||
// We don't need a check for the stream ID here.
|
||||
// The packetUnpacker checks that there's no unencrypted stream data except for the crypto stream.
|
||||
if frame.Offset != 0 {
|
||||
|
||||
Reference in New Issue
Block a user