1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 19:12:48 -05:00

Special host key warning when a better key exists.

If you're connecting to a new server and it _only_ provides host key
types you've configured to be below the warning threshold, it's OK to
give the standard askalg() message. But if you've newly demoted a host
key type and now reconnect to some server for which that type was the
best key you had cached, the askalg() wording isn't really appropriate
(it's not that the key we've settled on is the first type _supported
by the server_, it's that it's the first type _cached by us_), and
also it's potentially helpful to list the better algorithms so that
the user can pick one to cross-certify.
This commit is contained in:
Simon Tatham
2016-03-27 18:08:49 +01:00
parent 909a7af07c
commit 940a82fd37
6 changed files with 212 additions and 4 deletions

View File

@ -1232,10 +1232,17 @@ int verify_ssh_host_key(void *frontend, char *host, int port,
*/
int have_ssh_host_key(const char *host, int port, const char *keytype);
/*
* askalg has the same set of return values as verify_ssh_host_key.
* askalg and askhk have the same set of return values as
* verify_ssh_host_key.
*
* (askhk is used in the case where we're using a host key below the
* warning threshold because that's all we have cached, but at least
* one acceptable algorithm is available that we don't have cached.)
*/
int askalg(void *frontend, const char *algtype, const char *algname,
void (*callback)(void *ctx, int result), void *ctx);
int askhk(void *frontend, const char *algname, const char *betteralgs,
void (*callback)(void *ctx, int result), void *ctx);
/*
* askappend can return four values:
*