Browse Source

x/crypto/ssh: Add protocol version to ServerVersion

280be00 introduced custom server versions; however, at least OpenSSH
clients do not accept a server version that doesn't start with a
protocol version like "SSH-2.0-"; this is not documented in this
library, and automatically adding it in case that the user did not does
no harm.

Change-Id: Iafc23b23160a8277b10cbf29778dc64a96351bd7
Reviewed-on: https://go-review.googlesource.com/14018
Reviewed-by: Adam Langley <agl@golang.org>
Lewin Bormann 10 years ago
parent
commit
59a4410d82
1 changed files with 4 additions and 2 deletions
  1. 4 2
      ssh/server.go

+ 4 - 2
ssh/server.go

@@ -66,9 +66,11 @@ type ServerConfig struct {
 	// attempts.
 	// attempts.
 	AuthLogCallback func(conn ConnMetadata, method string, err error)
 	AuthLogCallback func(conn ConnMetadata, method string, err error)
 
 
-	// ServerVersion is the version identification string to
-	// announce in the public handshake.
+	// ServerVersion is the version identification string to announce in
+	// the public handshake.
 	// If empty, a reasonable default is used.
 	// If empty, a reasonable default is used.
+	// Note that RFC 4253 section 4.2 requires that this string start with
+	// "SSH-2.0-".
 	ServerVersion string
 	ServerVersion string
 }
 }