reject invalid active_connection_id_limit transport parameter values (#3687)

This commit is contained in:
Marten Seemann 2023-02-01 17:03:19 -08:00 committed by GitHub
parent 89769f409f
commit 3d9380ec3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 54 additions and 28 deletions

View file

@ -303,6 +303,9 @@ func (p *TransportParameters) readNumericTransportParameter(
}
p.MaxAckDelay = time.Duration(val) * time.Millisecond
case activeConnectionIDLimitParameterID:
if val < 2 {
return fmt.Errorf("invalid value for active_connection_id_limit: %d (minimum 2)", val)
}
p.ActiveConnectionIDLimit = val
case maxDatagramFrameSizeParameterID:
p.MaxDatagramFrameSize = protocol.ByteCount(val)