ssh: use *rsa.PublicKey or *dsa.PublicKey in interfaces.

Everywhere else in the code base, when we have an interface{} which is
a stand in for a public key, we use *foo.PublicKey rather than
foo.PublicKey. This change makes ssh reflect that.

R=dave, r
CC=golang-dev
https://golang.org/cl/5686067
This commit is contained in:
Adam Langley
2012-02-23 10:42:21 -05:00
parent 63736bd2bf
commit d33bbf2cb3
3 changed files with 9 additions and 10 deletions
+3 -3
View File
@@ -69,9 +69,9 @@ func (k *keychain) Key(i int) (interface{}, error) {
}
switch key := k.keys[i].(type) {
case *rsa.PrivateKey:
return key.PublicKey, nil
return &key.PublicKey, nil
case *dsa.PrivateKey:
return key.PublicKey, nil
return &key.PublicKey, nil
}
panic("unknown key type")
}
@@ -123,7 +123,7 @@ var (
return user == "testuser" && pass == string(clientPassword)
},
PublicKeyCallback: func(conn *ServerConn, user, algo string, pubkey []byte) bool {
key := clientKeychain.keys[0].(*rsa.PrivateKey).PublicKey
key := &clientKeychain.keys[0].(*rsa.PrivateKey).PublicKey
expected := []byte(serializePublickey(key))
algoname := algoName(key)
return user == "testuser" && algo == algoname && bytes.Equal(pubkey, expected)