go.crypto/ssh: add support for diffie-hellman-group1-sha1.

Fixes golang/go#2903.

R=golang-dev
CC=agl, golang-dev
https://golang.org/cl/5755054
This commit is contained in:
Daniel Theophanes
2012-03-06 11:25:32 -05:00
committed by Adam Langley
parent 79d53bd55e
commit 36a967d321
3 changed files with 25 additions and 1 deletions
+4
View File
@@ -105,6 +105,10 @@ func (c *ClientConn) handshake() error {
hashFunc = crypto.SHA1
dhGroup14Once.Do(initDHGroup14)
H, K, err = c.kexDH(dhGroup14, hashFunc, &magics, hostKeyAlgo)
case keyAlgoDH1SHA1:
hashFunc = crypto.SHA1
dhGroup1Once.Do(initDHGroup1)
H, K, err = c.kexDH(dhGroup1, hashFunc, &magics, hostKeyAlgo)
default:
err = fmt.Errorf("ssh: unexpected key exchange algorithm %v", kexAlgo)
}