(t *testing.T)
| 121 | } |
| 122 | |
| 123 | func TestClientAuthPublicKey(t *testing.T) { |
| 124 | signer := &loggingAlgorithmSigner{AlgorithmSigner: testSigners["rsa"].(AlgorithmSigner)} |
| 125 | config := &ClientConfig{ |
| 126 | User: "testuser", |
| 127 | Auth: []AuthMethod{ |
| 128 | PublicKeys(signer), |
| 129 | }, |
| 130 | HostKeyCallback: InsecureIgnoreHostKey(), |
| 131 | } |
| 132 | if err := tryAuth(t, config); err != nil { |
| 133 | t.Fatalf("unable to dial remote side: %s", err) |
| 134 | } |
| 135 | if len(signer.used) != 1 || signer.used[0] != KeyAlgoRSASHA256 { |
| 136 | t.Errorf("unexpected Sign/SignWithAlgorithm calls: %q", signer.used) |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | // TestClientAuthNoSHA2 tests a ssh-rsa Signer that doesn't implement AlgorithmSigner. |
| 141 | func TestClientAuthNoSHA2(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…