Skip to content

Commit 9732e03

Browse files
committed
ssh: add packetTypeNames map for better debug info
Change-Id: Ie1f58e00982568382e09d8f1dd12bf8a1dc1a9ed Reviewed-on: https://go-review.googlesource.com/c/crypto/+/171679 Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent d99183c commit 9732e03

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Diff for: ssh/messages.go

+26
Original file line numberDiff line numberDiff line change
@@ -764,3 +764,29 @@ func decode(packet []byte) (interface{}, error) {
764764
}
765765
return msg, nil
766766
}
767+
768+
var packetTypeNames = map[byte]string{
769+
msgDisconnect: "disconnectMsg",
770+
msgServiceRequest: "serviceRequestMsg",
771+
msgServiceAccept: "serviceAcceptMsg",
772+
msgKexInit: "kexInitMsg",
773+
msgKexDHInit: "kexDHInitMsg",
774+
msgKexDHReply: "kexDHReplyMsg",
775+
msgUserAuthRequest: "userAuthRequestMsg",
776+
msgUserAuthSuccess: "userAuthSuccessMsg",
777+
msgUserAuthFailure: "userAuthFailureMsg",
778+
msgUserAuthPubKeyOk: "userAuthPubKeyOkMsg",
779+
msgGlobalRequest: "globalRequestMsg",
780+
msgRequestSuccess: "globalRequestSuccessMsg",
781+
msgRequestFailure: "globalRequestFailureMsg",
782+
msgChannelOpen: "channelOpenMsg",
783+
msgChannelData: "channelDataMsg",
784+
msgChannelOpenConfirm: "channelOpenConfirmMsg",
785+
msgChannelOpenFailure: "channelOpenFailureMsg",
786+
msgChannelWindowAdjust: "windowAdjustMsg",
787+
msgChannelEOF: "channelEOFMsg",
788+
msgChannelClose: "channelCloseMsg",
789+
msgChannelRequest: "channelRequestMsg",
790+
msgChannelSuccess: "channelRequestSuccessMsg",
791+
msgChannelFailure: "channelRequestFailureMsg",
792+
}

0 commit comments

Comments
 (0)