Rearrange verify_ssh_host_key() for robustness in the face of strangeness, in
authorjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Mon, 21 Feb 2005 23:43:49 +0000 (23:43 +0000)
committerjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Mon, 21 Feb 2005 23:43:49 +0000 (23:43 +0000)
the same manner as windows/windlg.c (but tested this time :)

git-svn-id: svn://svn.tartarus.org/sgt/putty@5380 cda61777-01e9-0310-a592-d414129be87e

unix/gtkdlg.c

index 8ab8598..97af792 100644 (file)
@@ -2347,13 +2347,12 @@ int verify_ssh_host_key(void *frontend, char *host, int port, char *keytype,
 
     sfree(text);
 
-    if (ret == 0)
-        return 0;                      /* do not continue with connection */
-    else {
-        if (ret == 2)
-            store_host_key(host, port, keytype, keystr);
-        return 1;                      /* continue with connection */
-    }
+    if (ret == 2) {
+       store_host_key(host, port, keytype, keystr);
+       return 1;                      /* continue with connection */
+    } else if (ret == 1)
+       return 1;                      /* continue with connection */
+    return 0;                         /* do not continue with connection */
 }
 
 /*