forked from quic-go/quic-go
Merge pull request #2396 from lucas-clemente/fix-chacha20-header-protection
fix ChaCha20 header protection
This commit is contained in:
@@ -128,7 +128,7 @@ func (p *chachaHeaderProtector) apply(sample []byte, firstByte *byte, hdrBytes [
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
cipher.SetCounter(binary.BigEndian.Uint32(sample[4:]))
|
cipher.SetCounter(binary.LittleEndian.Uint32(sample[:4]))
|
||||||
cipher.XORKeyStream(p.mask[:], p.mask[:])
|
cipher.XORKeyStream(p.mask[:], p.mask[:])
|
||||||
p.applyMask(firstByte, hdrBytes)
|
p.applyMask(firstByte, hdrBytes)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user