X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/d4de2d2aba8680cc4f6db95d24377b22d9b644e8..1c2a93c4834e2cc84f29c997b16a28e2c9c4fb4d:/ssh.c diff --git a/ssh.c b/ssh.c index 3b4fcb2a..0db92fc2 100644 --- a/ssh.c +++ b/ssh.c @@ -1100,21 +1100,15 @@ static int do_ssh1_login(unsigned char *in, int inlen, int ispkt) j = makekey(pktin.body+8+i, &hostkey, &keystr2, 0); /* - * Hash the host key and print the hash in the log box. Just as - * a last resort in case the registry's host key checking is - * compromised, we'll allow the user some ability to verify - * host keys by eye. + * Log the host key fingerprint. */ - MD5Init(&md5c); - MD5Update(&md5c, keystr2, hostkey.bytes); - MD5Final(session_id, &md5c); { char logmsg[80]; - int i; - logevent("Host key MD5 is:"); + logevent("Host key fingerprint is:"); strcpy(logmsg, " "); - for (i = 0; i < 16; i++) - sprintf(logmsg+strlen(logmsg), "%02x", session_id[i]); + hostkey.comment = NULL; + rsa_fingerprint(logmsg+strlen(logmsg), sizeof(logmsg)-strlen(logmsg), + &hostkey); logevent(logmsg); }