]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Add missing check for failure to agree a host key algorithm.
authorSimon Tatham <anakin@pobox.com>
Mon, 4 Jun 2012 23:32:36 +0000 (23:32 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 4 Jun 2012 23:32:36 +0000 (23:32 +0000)
[originally from svn r9557]

ssh.c

diff --git a/ssh.c b/ssh.c
index 750017f65daff02b4724b238194481c6ce8a7890..ef503bf52160e96503828ad72bbd5d67c377031e 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -5778,6 +5778,12 @@ static int do_ssh2_transport(Ssh ssh, void *vin, int inlen,
                break;
            }
        }
+       if (!ssh->hostkey) {
+           bombout(("Couldn't agree a host key algorithm (available: %s)",
+                    str ? str : "(null)"));
+           crStop(0);
+       }
+
        s->guessok = s->guessok &&
            first_in_commasep_string(hostkey_algs[0]->name, str, len);
        ssh_pkt_getstring(pktin, &str, &len);    /* client->server cipher */