Loose end from r5031: the Kex panel should only be displayed in
[u/mdw/putty] / config.c
index 6d918c2..6a5961c 100644 (file)
--- a/config.c
+++ b/config.c
@@ -770,7 +770,7 @@ static void portfwd_handler(union control *ctrl, void *dlg,
 }
 
 void setup_config_box(struct controlbox *b, struct sesslist *sesslist,
-                     int midsession, int protocol)
+                     int midsession, int protocol, int protcfginfo)
 {
     struct controlset *s;
     struct sessionsaver_data *ssd;
@@ -1583,33 +1583,36 @@ void setup_config_box(struct controlbox *b, struct sesslist *sesslist,
 
        /*
         * The Connection/SSH/Kex panel. (Owing to repeat key
-        * exchange, this is all meaningful in mid-session.)
+        * exchange, this is all meaningful in mid-session _if_
+        * we're using SSH2 or haven't decided yet.)
         */
-       ctrl_settitle(b, "Connection/SSH/Kex",
-                     "Options controlling SSH key exchange");
-
-       s = ctrl_getset(b, "Connection/SSH/Kex", "main",
-                       "Key exchange algorithm options");
-       c = ctrl_draglist(s, "Algorithm selection policy", 's',
-                         HELPCTX(ssh_kexlist),
-                         kexlist_handler, P(NULL));
-       c->listbox.height = 5;
-
-       s = ctrl_getset(b, "Connection/SSH/Kex", "repeat",
-                       "Options controlling key re-exchange");
-
-       ctrl_editbox(s, "Max minutes before rekey (0 for no limit)", 't', 20,
-                    HELPCTX(ssh_kex_repeat),
-                    dlg_stdeditbox_handler,
-                    I(offsetof(Config,ssh_rekey_time)),
-                    I(-1));
-       ctrl_editbox(s, "Max data before rekey (0 for no limit)", 'x', 20,
-                    HELPCTX(ssh_kex_repeat),
-                    dlg_stdeditbox_handler,
-                    I(offsetof(Config,ssh_rekey_data)),
-                    I(16));
-       ctrl_text(s, "(Use 1M for 1 megabyte, 1G for 1 gigabyte etc)",
-                 HELPCTX(ssh_kex_repeat));
+       if (protcfginfo != 1) {
+           ctrl_settitle(b, "Connection/SSH/Kex",
+                         "Options controlling SSH key exchange");
+
+           s = ctrl_getset(b, "Connection/SSH/Kex", "main",
+                           "Key exchange algorithm options");
+           c = ctrl_draglist(s, "Algorithm selection policy", 's',
+                             HELPCTX(ssh_kexlist),
+                             kexlist_handler, P(NULL));
+           c->listbox.height = 5;
+
+           s = ctrl_getset(b, "Connection/SSH/Kex", "repeat",
+                           "Options controlling key re-exchange");
+
+           ctrl_editbox(s, "Max minutes before rekey (0 for no limit)", 't', 20,
+                        HELPCTX(ssh_kex_repeat),
+                        dlg_stdeditbox_handler,
+                        I(offsetof(Config,ssh_rekey_time)),
+                        I(-1));
+           ctrl_editbox(s, "Max data before rekey (0 for no limit)", 'x', 20,
+                        HELPCTX(ssh_kex_repeat),
+                        dlg_stdeditbox_handler,
+                        I(offsetof(Config,ssh_rekey_data)),
+                        I(16));
+           ctrl_text(s, "(Use 1M for 1 megabyte, 1G for 1 gigabyte etc)",
+                     HELPCTX(ssh_kex_repeat));
+       }
 
        if (!midsession) {