code review 22890043: gosshnew/ssh: require a hostkey for the server handshake. (issue 22890043)

40 views
Skip to first unread message

han...@google.com

unread,
Nov 7, 2013, 11:27:20 AM11/7/13
to a...@golang.org, da...@cheney.net, jps...@google.com, a...@golang.org, d...@golang.org, golan...@googlegroups.com, re...@codereview-hr.appspotmail.com
Reviewers: agl1, dfc, jpsugar,

Message:
Hello agl1, dfc, jps...@google.com (cc: a...@golang.org, d...@golang.org,
golan...@googlegroups.com, han...@google.com),

I'd like you to review this change to
https://hanwen%40goog...@code.google.com/p/gosshnew/


Description:
gosshnew/ssh: require a hostkey for the server handshake.

Please review this at https://codereview.appspot.com/22890043/

Affected files (+4, -0 lines):
M ssh/server.go


Index: ssh/server.go
===================================================================
--- a/ssh/server.go
+++ b/ssh/server.go
@@ -142,6 +142,10 @@

// Handshake performs an SSH transport and client authentication on the
given ServerConn.
func (s *ServerConn) Handshake() error {
+ if len(s.config.hostKeys) == 0 {
+ return errors.New("ssh: server has no host keys")
+ }
+
var err error
s.serverVersion = []byte(packageVersion)
s.ClientVersion, err = exchangeVersions(s.sshConn.conn, s.serverVersion)


jps...@google.com

unread,
Nov 7, 2013, 2:17:23 PM11/7/13
to han...@google.com, a...@golang.org, da...@cheney.net, golan...@googlegroups.com, han...@google.com, re...@codereview-hr.appspotmail.com

han...@google.com

unread,
Nov 8, 2013, 6:23:53 AM11/8/13
to han...@google.com, a...@golang.org, da...@cheney.net, jps...@google.com, d...@golang.org, golan...@googlegroups.com, re...@codereview-hr.appspotmail.com
*** Submitted as
https://code.google.com/p/gosshnew/source/detail?r=9cdf2c59c9d7 ***

gosshnew/ssh: require a hostkey for the server handshake.

R=agl, dave, jpsugar
CC=agl, dfc, golang-dev, hanwen
https://codereview.appspot.com/22890043


https://codereview.appspot.com/22890043/
Reply all
Reply to author
Forward
0 new messages