mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-16 12:03:03 -05:00
Fix segfault if the server maliciously sends the wrong type of key
after a different type has been agreed. [originally from svn r1165]
This commit is contained in:
parent
a4c1aad9b2
commit
4fb01728e1
5
ssh.c
5
ssh.c
@ -2955,8 +2955,9 @@ static int do_ssh2_transport(unsigned char *in, int inlen, int ispkt)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
hkey = hostkey->newkey(hostkeydata, hostkeylen);
|
hkey = hostkey->newkey(hostkeydata, hostkeylen);
|
||||||
if (!hostkey->verifysig(hkey, sigdata, siglen, exchange_hash, 20)) {
|
if (!hkey ||
|
||||||
bombout(("Server failed host key check"));
|
!hostkey->verifysig(hkey, sigdata, siglen, exchange_hash, 20)) {
|
||||||
|
bombout(("Server's host key did not match the signature supplied"));
|
||||||
crReturn(0);
|
crReturn(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user