mirror of
https://github.com/tmate-io/tmate.git
synced 2025-06-20 09:37:53 +02:00
Better debugging when keys are not matching
This commit is contained in:
parent
339e6c4357
commit
cbec43f56d
@ -328,7 +328,7 @@ static void on_ssh_client_event(struct tmate_ssh_client *client)
|
|||||||
|
|
||||||
if (ssh_get_publickey_hash(pubkey, SSH_PUBLICKEY_HASH_SHA256,
|
if (ssh_get_publickey_hash(pubkey, SSH_PUBLICKEY_HASH_SHA256,
|
||||||
&hash, &hash_len) < 0) {
|
&hash, &hash_len) < 0) {
|
||||||
kill_ssh_client(client, "Cannot authenticate server");
|
kill_ssh_client(client, "Failed to get server fingerprint");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,15 +362,17 @@ static void on_ssh_client_event(struct tmate_ssh_client *client)
|
|||||||
}
|
}
|
||||||
|
|
||||||
match = !strcmp(hash_str, server_hash_str);
|
match = !strcmp(hash_str, server_hash_str);
|
||||||
|
if (!match) {
|
||||||
|
kill_ssh_client(client, "Server fingerprint not recognized: "
|
||||||
|
"`%s', expected `%s'", server_hash_str, hash_str);
|
||||||
|
}
|
||||||
|
|
||||||
ssh_key_free(pubkey);
|
ssh_key_free(pubkey);
|
||||||
ssh_clean_pubkey_hash(&hash);
|
ssh_clean_pubkey_hash(&hash);
|
||||||
free(hash_str);
|
free(hash_str);
|
||||||
|
|
||||||
if (!match) {
|
if (!match)
|
||||||
kill_ssh_client(client, "Cannot authenticate server");
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* At this point, we abort other connection attempts to the
|
* At this point, we abort other connection attempts to the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user