forked from quic-go/quic-go
committed by
Lucas Clemente
parent
5ec7ee7f01
commit
956bfa2d5a
@@ -107,9 +107,11 @@ func ParsePublicHeader(b io.ByteReader) (*PublicHeader, error) {
|
|||||||
header.VersionFlag = publicFlagByte&0x01 > 0
|
header.VersionFlag = publicFlagByte&0x01 > 0
|
||||||
header.ResetFlag = publicFlagByte&0x02 > 0
|
header.ResetFlag = publicFlagByte&0x02 > 0
|
||||||
|
|
||||||
if publicFlagByte&0x04 > 0 {
|
// TODO: activate this check once Chrome sends the correct value
|
||||||
return nil, errors.New("diversification nonces should only be sent by servers")
|
// see https://github.com/lucas-clemente/quic-go/issues/232
|
||||||
}
|
// if publicFlagByte&0x04 > 0 {
|
||||||
|
// return nil, errors.New("diversification nonces should only be sent by servers")
|
||||||
|
// }
|
||||||
|
|
||||||
if publicFlagByte&0x08 == 0 {
|
if publicFlagByte&0x08 == 0 {
|
||||||
return nil, errReceivedTruncatedConnectionID
|
return nil, errReceivedTruncatedConnectionID
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ var _ = Describe("Public Header", func() {
|
|||||||
Expect(b.Len()).To(BeZero())
|
Expect(b.Len()).To(BeZero())
|
||||||
})
|
})
|
||||||
|
|
||||||
It("rejects diversification nonces sent by the client", func() {
|
PIt("rejects diversification nonces sent by the client", func() {
|
||||||
b := bytes.NewReader([]byte{0x0c, 0xf6, 0x19, 0x86, 0x66, 0x9b, 0x9f, 0xfa, 0x4c,
|
b := bytes.NewReader([]byte{0x0c, 0xf6, 0x19, 0x86, 0x66, 0x9b, 0x9f, 0xfa, 0x4c,
|
||||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,
|
||||||
0x01,
|
0x01,
|
||||||
|
|||||||
Reference in New Issue
Block a user