add fuzzing for transport parameters

This commit is contained in:
Marten Seemann 2020-08-08 15:34:56 +07:00
parent 32b3ce645a
commit 2593b1af81
23 changed files with 153 additions and 3 deletions

View file

@ -358,9 +358,11 @@ func (p *TransportParameters) Marshal(pers protocol.Perspective) []byte {
}
if pers == protocol.PerspectiveServer {
// stateless_reset_token
utils.WriteVarInt(b, uint64(statelessResetTokenParameterID))
utils.WriteVarInt(b, 16)
b.Write(p.StatelessResetToken[:])
if p.StatelessResetToken != nil {
utils.WriteVarInt(b, uint64(statelessResetTokenParameterID))
utils.WriteVarInt(b, 16)
b.Write(p.StatelessResetToken[:])
}
// original_destination_connection_id
utils.WriteVarInt(b, uint64(originalDestinationConnectionIDParameterID))
utils.WriteVarInt(b, uint64(p.OriginalDestinationConnectionID.Len()))