1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-10 23:58:06 -05:00

Emit a distinct error message when the SSH server's host key is invalid.

This also means that FUZZING can just ignore host-key verification
failure while preserving invalid-host-key errors.
This commit is contained in:
Ben Harris 2015-10-18 20:16:39 +01:00
parent 12702cb17e
commit 7a5cb2838f

10
ssh.c
View File

@ -7126,13 +7126,17 @@ static void do_ssh2_transport(Ssh ssh, const void *vin, int inlen,
dmemdump(s->exchange_hash, ssh->kex->hash->hlen);
#endif
if (!s->hkey ||
!ssh->hostkey->verifysig(s->hkey, s->sigdata, s->siglen,
if (!s->hkey) {
bombout(("Server's host key is invalid"));
crStopV;
}
if (!ssh->hostkey->verifysig(s->hkey, s->sigdata, s->siglen,
(char *)s->exchange_hash,
ssh->kex->hash->hlen)) {
#ifndef FUZZING
bombout(("Server's host key did not match the signature supplied"));
crStopV;
crStopV;f
#endif
}