go.crypto/ssh: in {Server,Client}Conn, read session ID from
transport layer. R=agl, dave CC=golang-dev https://golang.org/cl/15870044
This commit is contained in:
committed by
Adam Langley
parent
c0d640c887
commit
34df1ce598
+3
-3
@@ -186,7 +186,7 @@ func (s *ServerConn) Handshake() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := s.authenticate(s.transport.sessionID); err != nil {
|
||||
if err := s.authenticate(); err != nil {
|
||||
return err
|
||||
}
|
||||
return err
|
||||
@@ -310,7 +310,7 @@ func (s *ServerConn) testPubKey(user, algo string, pubKey []byte) bool {
|
||||
return result
|
||||
}
|
||||
|
||||
func (s *ServerConn) authenticate(H []byte) error {
|
||||
func (s *ServerConn) authenticate() error {
|
||||
var userAuthReq userAuthRequestMsg
|
||||
var err error
|
||||
var packet []byte
|
||||
@@ -409,7 +409,7 @@ userAuthLoop:
|
||||
if !isAcceptableAlgo(algo) || !isAcceptableAlgo(sig.Format) || pubAlgoToPrivAlgo(algo) != sig.Format {
|
||||
break
|
||||
}
|
||||
signedData := buildDataSignedForAuth(H, userAuthReq, algoBytes, pubKey)
|
||||
signedData := buildDataSignedForAuth(s.transport.sessionID, userAuthReq, algoBytes, pubKey)
|
||||
key, _, ok := ParsePublicKey(pubKey)
|
||||
if !ok {
|
||||
return ParseError{msgUserAuthRequest}
|
||||
|
||||
Reference in New Issue
Block a user