ssh: make client auth tests less chatty.
Change-Id: Ib35ce0e7437e32a3fa24a9330c479306b7fa6880
Reviewed-on: https://go-review.googlesource.com/35011
Reviewed-by: Adam Langley <agl@golang.org>
diff --git a/ssh/client_auth_test.go b/ssh/client_auth_test.go
index 1409276..1d9681a 100644
--- a/ssh/client_auth_test.go
+++ b/ssh/client_auth_test.go
@@ -77,7 +77,6 @@
return nil, errors.New("keyboard-interactive failed")
},
AuthLogCallback: func(conn ConnMetadata, method string, err error) {
- t.Logf("user %q, method %q: %v", conn.User(), method, err)
},
}
serverConfig.AddHostKey(testSigners["rsa"])
@@ -278,18 +277,18 @@
}
clientConfig.Auth = append(clientConfig.Auth, PublicKeys(certSigner))
- t.Log("should succeed")
+ // should succeed
if err := tryAuth(t, clientConfig); err != nil {
t.Errorf("cert login failed: %v", err)
}
- t.Log("corrupted signature")
+ // corrupted signature
cert.Signature.Blob[0]++
if err := tryAuth(t, clientConfig); err == nil {
t.Errorf("cert login passed with corrupted sig")
}
- t.Log("revoked")
+ // revoked
cert.Serial = 666
cert.SignCert(rand.Reader, testSigners["ecdsa"])
if err := tryAuth(t, clientConfig); err == nil {
@@ -297,13 +296,13 @@
}
cert.Serial = 1
- t.Log("sign with wrong key")
+ // sign with wrong key
cert.SignCert(rand.Reader, testSigners["dsa"])
if err := tryAuth(t, clientConfig); err == nil {
t.Errorf("cert login passed with non-authoritative key")
}
- t.Log("host cert")
+ // host cert
cert.CertType = HostCert
cert.SignCert(rand.Reader, testSigners["ecdsa"])
if err := tryAuth(t, clientConfig); err == nil {
@@ -311,14 +310,14 @@
}
cert.CertType = UserCert
- t.Log("principal specified")
+ // principal specified
cert.ValidPrincipals = []string{"user"}
cert.SignCert(rand.Reader, testSigners["ecdsa"])
if err := tryAuth(t, clientConfig); err != nil {
t.Errorf("cert login failed: %v", err)
}
- t.Log("wrong principal specified")
+ // wrong principal specified
cert.ValidPrincipals = []string{"fred"}
cert.SignCert(rand.Reader, testSigners["ecdsa"])
if err := tryAuth(t, clientConfig); err == nil {
@@ -326,21 +325,21 @@
}
cert.ValidPrincipals = nil
- t.Log("added critical option")
+ // added critical option
cert.CriticalOptions = map[string]string{"root-access": "yes"}
cert.SignCert(rand.Reader, testSigners["ecdsa"])
if err := tryAuth(t, clientConfig); err == nil {
t.Errorf("cert login passed with unrecognized critical option")
}
- t.Log("allowed source address")
+ // allowed source address
cert.CriticalOptions = map[string]string{"source-address": "127.0.0.42/24"}
cert.SignCert(rand.Reader, testSigners["ecdsa"])
if err := tryAuth(t, clientConfig); err != nil {
t.Errorf("cert login with source-address failed: %v", err)
}
- t.Log("disallowed source address")
+ // disallowed source address
cert.CriticalOptions = map[string]string{"source-address": "127.0.0.42"}
cert.SignCert(rand.Reader, testSigners["ecdsa"])
if err := tryAuth(t, clientConfig); err == nil {