Add missing check for failure to agree a host key algorithm.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Mon, 4 Jun 2012 23:32:36 +0000 (23:32 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Mon, 4 Jun 2012 23:32:36 +0000 (23:32 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/putty@9557 cda61777-01e9-0310-a592-d414129be87e

ssh.c

diff --git a/ssh.c b/ssh.c
index 750017f..ef503bf 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 */