X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/cabfd08c97213abe46f996a93407f8209fc38b94..6c4edc71a0877c4d3376f60466064119ff17c707:/ssh.c diff --git a/ssh.c b/ssh.c index caf98ce0..d31d823e 100644 --- a/ssh.c +++ b/ssh.c @@ -385,7 +385,21 @@ static void ssh_protocol(unsigned char *in, int inlen, int ispkt) { 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];