Merge pull request #2226 from lucas-clemente/retry-integrity

implement the retry integrity tag
This commit is contained in:
Marten Seemann
2020-01-17 17:19:15 +07:00
committed by GitHub
13 changed files with 168 additions and 113 deletions

View File

@@ -253,8 +253,7 @@ var _ = Describe("MITM test", func() {
It("downloads a message when packet are corrupted towards the client", func() {
dropCb := func(dir quicproxy.Direction, raw []byte) bool {
defer GinkgoRecover()
isRetry := raw[0]&0xc0 == 0xc0 // don't corrupt Retry packets
if dir == quicproxy.DirectionOutgoing && mrand.Intn(interval) == 0 && !isRetry {
if dir == quicproxy.DirectionOutgoing && mrand.Intn(interval) == 0 {
pos := mrand.Intn(len(raw))
raw[pos] = byte(mrand.Intn(256))
_, err := serverConn.WriteTo(raw, clientConn.LocalAddr())