x/crypto/ssh: hide msgNewKeys in the transport layer.

This ensures that extraneous key exchanges cannot confuse application
level code.

Change-Id: I1a333e2b7b46f1e484406a79db7a949294e79c6d
Reviewed-on: https://go-review.googlesource.com/22417
Reviewed-by: Han-Wen Nienhuys <hanwen@google.com>
Run-TryBot: Han-Wen Nienhuys <hanwen@google.com>
Reviewed-by: Adam Langley <agl@golang.org>
This commit is contained in:
Han-Wen Nienhuys
2016-05-10 17:36:43 +00:00
committed by Adam Langley
parent 91ab96ae98
commit b76c864ef1
5 changed files with 77 additions and 43 deletions
-6
View File
@@ -101,12 +101,6 @@ func (c *connection) clientHandshake(dialAddress string, config *ClientConfig) e
return err
}
if packet, err := c.transport.readPacket(); err != nil {
return err
} else if packet[0] != msgNewKeys {
return unexpectedMessageError(msgNewKeys, packet[0])
}
// We just did the key change, so the session ID is established.
c.sessionID = c.transport.getSessionID()