]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix log message about alternate host keys.
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Sat, 26 Mar 2016 18:40:16 +0000 (18:40 +0000)
committerJacob Nevins <jacobn@chiark.greenend.org.uk>
Sat, 26 Mar 2016 18:47:54 +0000 (18:47 +0000)
Since we got a dynamic preference order, it's been bailing out at a
random point, and listing keys we wouldn't use.
(It would still be nice to only mention keys that we'd actually use, but
that's now quite fiddly.)

ssh.c

diff --git a/ssh.c b/ssh.c
index 75515df11a4558e77853cc158f0bd150f2622df6..c5e5993c253e4634c0b7c0c02bafc3cc2fe16dff 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -7253,16 +7253,14 @@ static void do_ssh2_transport(Ssh ssh, const void *vin, int inlen,
     s->keystr = ssh->hostkey->fmtkey(s->hkey);
     if (!s->got_session_id) {
        /*
-        * Make a note of any host key format we'd have preferred to use,
-        * had we already known the corresponding keys.
+        * Make a note of any other host key formats that are available.
         */
        {
            int i, j = 0;
            char *list = NULL;
            for (i = 0; i < lenof(hostkey_algs); i++) {
                if (hostkey_algs[i].alg == ssh->hostkey)
-                   /* Not worth mentioning key types we wouldn't use */
-                   break;
+                   continue;
                else if (ssh->uncert_hostkeys[j] == i) {
                    char *newlist;
                    if (list)
@@ -7284,10 +7282,9 @@ static void do_ssh2_transport(Ssh ssh, const void *vin, int inlen,
            }
            if (list) {
                logeventf(ssh,
-                         "Server has %s host key%s, but we don't know %s; "
-                         "using %s instead",
-                         list, j ? "s" : "", j ? "any of them" : "it",
-                         ssh->hostkey->name);
+                         "Server also has %s host key%s, but we "
+                         "don't know %s", list,
+                         j > 1 ? "s" : "", j > 1 ? "any of them" : "it");
                sfree(list);
            }
        }