implement rules for frame types in 0-RTT packets

This commit is contained in:
Marten Seemann
2019-07-01 09:44:29 +07:00
parent b1fc984306
commit b0c08b1bd0
2 changed files with 24 additions and 1 deletions

View File

@@ -106,11 +106,21 @@ func (p *frameParser) isAllowedAtEncLevel(f Frame, encLevel protocol.EncryptionL
switch f.(type) {
case *CryptoFrame, *AckFrame, *ConnectionCloseFrame, *PingFrame:
return true
default:
return false
}
case protocol.Encryption0RTT:
switch f.(type) {
case *CryptoFrame, *AckFrame, *ConnectionCloseFrame, *NewTokenFrame, *PathResponseFrame, *RetireConnectionIDFrame:
return false
default:
return true
}
case protocol.Encryption1RTT:
return true
default:
panic("unknown encryption level")
}
return false
}
func (p *frameParser) SetAckDelayExponent(exp uint8) {