aboutsummaryrefslogtreecommitdiff
path: root/ssh/client_auth_test.go
diff options
context:
space:
mode:
authorAdam Langley <agl@golang.org>2012-02-23 10:42:21 -0500
committerAdam Langley <agl@golang.org>2012-02-23 10:42:21 -0500
commitd33bbf2cb3b8574ad57ddba26f03e861c01f69c5 (patch)
treec74823bb20f37958d7aa17d65a95bdb6856fe35d /ssh/client_auth_test.go
parent63736bd2bfc680f74ba4e026c1cc4fd3ebf113ed (diff)
downloadgo-x-crypto-d33bbf2cb3b8574ad57ddba26f03e861c01f69c5.tar.xz
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
Diffstat (limited to 'ssh/client_auth_test.go')
-rw-r--r--ssh/client_auth_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/ssh/client_auth_test.go b/ssh/client_auth_test.go
index a55d8f4..e51bdc3 100644
--- a/ssh/client_auth_test.go
+++ b/ssh/client_auth_test.go
@@ -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)