mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 11:32:48 -05:00
Mention the host name in host-key prompts.
Now that it's possible for a single invocation of PuTTY to connect to multiple SSH servers (jump host followed by ultimate destination host), it's rather unhelpful for host key prompts to just say "the server". To check an unknown host key, users will need to know _which_ host it's purporting to be the key for. Another possibility is to put a message in the terminal window indicating which server we're currently in the SSH setup phase for. That will certainly be what we have to end up doing for userpass prompts that appear _in_ the terminal window. But that by itself is still unhelpful for host key prompts in a separate dialog, because the user would have to check both windows to get all the information they need. Easier if the host key dialog itself tells you everything you need to know to answer the question: is _this_ key the one you expect for _that_ host?
This commit is contained in:
@ -126,11 +126,13 @@ int console_verify_ssh_host_key(
|
||||
ssh2_pick_default_fingerprint(fingerprints);
|
||||
|
||||
if (ret == 2) { /* key was different */
|
||||
common = hk_wrongmsg_common(keytype, fingerprints[fptype_default]);
|
||||
common = hk_wrongmsg_common(host, port, keytype,
|
||||
fingerprints[fptype_default]);
|
||||
intro = hk_wrongmsg_interactive_intro;
|
||||
prompt = hk_wrongmsg_interactive_prompt;
|
||||
} else { /* key was absent */
|
||||
common = hk_absentmsg_common(keytype, fingerprints[fptype_default]);
|
||||
common = hk_absentmsg_common(host, port, keytype,
|
||||
fingerprints[fptype_default]);
|
||||
intro = hk_absentmsg_interactive_intro;
|
||||
prompt = hk_absentmsg_interactive_prompt;
|
||||
}
|
||||
|
@ -3545,10 +3545,12 @@ int gtk_seat_verify_ssh_host_key(
|
||||
void (*callback)(void *ctx, int result), void *ctx)
|
||||
{
|
||||
static const char absenttxt[] =
|
||||
"The server's host key is not cached. You have no guarantee "
|
||||
"that the server is the computer you think it is.\n"
|
||||
"The server's %s key fingerprint is:\n"
|
||||
"%s\n"
|
||||
"The host key is not cached for this server:\n\n"
|
||||
"%s (port %d)\n\n"
|
||||
"You have no guarantee that the server is the computer "
|
||||
"you think it is.\n"
|
||||
"The server's %s key fingerprint is:\n\n"
|
||||
"%s\n\n"
|
||||
"If you trust this host, press \"Accept\" to add the key to "
|
||||
"PuTTY's cache and carry on connecting.\n"
|
||||
"If you want to carry on connecting just once, without "
|
||||
@ -3557,12 +3559,14 @@ int gtk_seat_verify_ssh_host_key(
|
||||
"connection.";
|
||||
static const char wrongtxt[] =
|
||||
"WARNING - POTENTIAL SECURITY BREACH!\n"
|
||||
"The server's host key does not match the one PuTTY has "
|
||||
"cached. This means that either the server administrator "
|
||||
"has changed the host key, or you have actually connected "
|
||||
"The host key does not match the one PuTTY has cached "
|
||||
"for this server:\n\n"
|
||||
"%s (port %d)\n\n"
|
||||
"This means that either the server administrator has "
|
||||
"changed the host key, or you have actually connected "
|
||||
"to another computer pretending to be the server.\n"
|
||||
"The new %s key fingerprint is:\n"
|
||||
"%s\n"
|
||||
"The new %s key fingerprint is:\n\n"
|
||||
"%s\n\n"
|
||||
"If you were expecting this change and trust the new key, "
|
||||
"press \"Accept\" to update PuTTY's cache and continue connecting.\n"
|
||||
"If you want to carry on connecting but without updating "
|
||||
@ -3595,8 +3599,8 @@ int gtk_seat_verify_ssh_host_key(
|
||||
FingerprintType fptype_default =
|
||||
ssh2_pick_default_fingerprint(fingerprints);
|
||||
|
||||
text = dupprintf((ret == 2 ? wrongtxt : absenttxt), keytype,
|
||||
fingerprints[fptype_default]);
|
||||
text = dupprintf((ret == 2 ? wrongtxt : absenttxt), host, port,
|
||||
keytype, fingerprints[fptype_default]);
|
||||
|
||||
result_ctx = snew(struct verify_ssh_host_key_dialog_ctx);
|
||||
result_ctx->callback = callback;
|
||||
|
Reference in New Issue
Block a user