X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/641ba8ef4fe95216e94fd548a2f189bf48dfb9c1..89ee5268a99aac30dbdf36bc3a02074d34e653f2:/scpssh.c diff --git a/scpssh.c b/scpssh.c index 5db056a4..3c45c9ac 100644 --- a/scpssh.c +++ b/scpssh.c @@ -281,7 +281,21 @@ static void ssh_login(char *username, char *cmd) if (!rsabuf) fatalbox("Out of memory"); - verify_ssh_host_key(savedhost, &hostkey); + /* + * Verify the host key. + */ + { + /* + * First format the key into a string. + */ + int len = rsastr_len(&hostkey); + char *keystr = malloc(len); + if (!keystr) + fatalbox("Out of memory"); + rsastr_fmt(keystr, &hostkey); + verify_ssh_host_key(savedhost, keystr); + free(keystr); + } for (i=0; i<32; i++) { rsabuf[i] = session_key[i];