diff --git a/ssh/channel.go b/ssh/channel.go index 6d82bd4..40f0aa0 100644 --- a/ssh/channel.go +++ b/ssh/channel.go @@ -61,7 +61,7 @@ func (c ChannelRequest) Error() string { // RejectionReason is an enumeration used when rejecting channel creation // requests. See RFC 4254, section 5.1. -type RejectionReason int +type RejectionReason uint32 const ( Prohibited RejectionReason = iota + 1 diff --git a/ssh/messages_test.go b/ssh/messages_test.go index 24a8bd9..fb94404 100644 --- a/ssh/messages_test.go +++ b/ssh/messages_test.go @@ -40,6 +40,7 @@ var messageTypes = []interface{}{ &userAuthRequestMsg{}, &channelOpenMsg{}, &channelOpenConfirmMsg{}, + &channelOpenFailureMsg{}, &channelRequestMsg{}, &channelRequestSuccessMsg{}, } @@ -124,6 +125,13 @@ func (*kexDHInitMsg) Generate(rand *rand.Rand, size int) reflect.Value { return reflect.ValueOf(dhi) } +// TODO(dfc) maybe this can be removed in the future if testing/quick can handle +// derived basic types. +func (RejectionReason) Generate(rand *rand.Rand, size int) reflect.Value { + m := RejectionReason(Prohibited) + return reflect.ValueOf(m) +} + var ( _kexInitMsg = new(kexInitMsg).Generate(rand.New(rand.NewSource(0)), 10).Elem().Interface() _kexDHInitMsg = new(kexDHInitMsg).Generate(rand.New(rand.NewSource(0)), 10).Elem().Interface()