MCPcopy Index your code
hub / github.com/tailscale/tailscale / TestClientAuthPublicKey

Function TestClientAuthPublicKey

tempfork/sshtest/ssh/client_auth_test.go:123–138  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

121}
122
123func 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.
141func TestClientAuthNoSHA2(t *testing.T) {

Callers

nothing calls this directly

Calls 5

PublicKeysFunction · 0.85
InsecureIgnoreHostKeyFunction · 0.85
tryAuthFunction · 0.85
FatalfMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…