First phase of porting. pterm now compiles and runs under Linux+gtk.
[u/mdw/putty] / settings.c
index 8764bb3..4bc11ec 100644 (file)
@@ -2,7 +2,6 @@
  * settings.c: read and write saved sessions.
  */
 
-#include <windows.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include "putty.h"
@@ -189,7 +188,6 @@ void save_settings(char *section, int do_host, Config * cfg)
     write_setting_i(sesskey, "AuthTIS", cfg->try_tis_auth);
     write_setting_i(sesskey, "AuthKI", cfg->try_ki_auth);
     write_setting_i(sesskey, "SshProt", cfg->sshprot);
-    write_setting_i(sesskey, "BuggyMAC", cfg->buggymac);
     write_setting_i(sesskey, "SSH2DES", cfg->ssh2_des_cbc);
     write_setting_s(sesskey, "PublicKeyFile", cfg->keyfile);
     write_setting_s(sesskey, "RemoteCommand", cfg->remote_cmd);
@@ -304,7 +302,13 @@ void save_settings(char *section, int do_host, Config * cfg)
        *p = '\0';
        write_setting_s(sesskey, "PortForwardings", buf);
     }
-
+    write_setting_i(sesskey, "BugIgnore1", cfg->sshbug_ignore1);
+    write_setting_i(sesskey, "BugPlainPW1", cfg->sshbug_plainpw1);
+    write_setting_i(sesskey, "BugRSA1", cfg->sshbug_rsa1);
+    write_setting_i(sesskey, "BugHMAC2", cfg->sshbug_hmac2);
+    write_setting_i(sesskey, "BugDeriveKey2", cfg->sshbug_derivekey2);
+    write_setting_i(sesskey, "BugRSAPad2", cfg->sshbug_rsapad2);
+    write_setting_i(sesskey, "BugDHGEx2", cfg->sshbug_dhgex2);
     close_settings_w(sesskey);
 }
 
@@ -366,7 +370,7 @@ void load_settings(char *section, int do_host, Config * cfg)
         sizeof(cfg->proxy_username));
     gpps(sesskey, "ProxyPassword", "", cfg->proxy_password,
         sizeof(cfg->proxy_password));
-    gpps(sesskey, "ProxyTelnetCommand", "connect %host %port",
+    gpps(sesskey, "ProxyTelnetCommand", "connect %host %port\\n",
         cfg->proxy_telnet_command, sizeof(cfg->proxy_telnet_command));
     gppi(sesskey, "ProxySOCKSVersion", 5, &cfg->proxy_socks_version);
 
@@ -400,7 +404,6 @@ void load_settings(char *section, int do_host, Config * cfg)
     gprefs(sesskey, "Cipher", "\0",
           ciphernames, CIPHER_MAX, cfg->ssh_cipherlist);
     gppi(sesskey, "SshProt", 1, &cfg->sshprot);
-    gppi(sesskey, "BuggyMAC", 0, &cfg->buggymac);
     gppi(sesskey, "SSH2DES", 0, &cfg->ssh2_des_cbc);
     gppi(sesskey, "AuthTIS", 0, &cfg->try_tis_auth);
     gppi(sesskey, "AuthKI", 1, &cfg->try_ki_auth);
@@ -460,8 +463,11 @@ void load_settings(char *section, int do_host, Config * cfg)
     gppi(sesskey, "TermHeight", 24, &cfg->height);
     gpps(sesskey, "Font", "Courier New", cfg->font, sizeof(cfg->font));
     gppi(sesskey, "FontIsBold", 0, &cfg->fontisbold);
+#ifdef _WINDOWS
     gppi(sesskey, "FontCharSet", ANSI_CHARSET, &cfg->fontcharset);
+#endif
     gppi(sesskey, "FontHeight", 10, &cfg->fontheight);
+#ifdef _WINDOWS
     if (cfg->fontheight < 0) {
        int oldh, newh;
        HDC hdc = GetDC(NULL);
@@ -474,6 +480,7 @@ void load_settings(char *section, int do_host, Config * cfg)
            newh--;
        cfg->fontheight = newh;
     }
+#endif
     gppi(sesskey, "FontVTMode", VT_UNICODE, (int *) &cfg->vtmode);
     gppi(sesskey, "TryPalette", 0, &cfg->try_palette);
     gppi(sesskey, "BoldAsColour", 1, &cfg->bold_colour);
@@ -566,6 +573,21 @@ void load_settings(char *section, int do_host, Config * cfg)
        }
        *q = '\0';
     }
+    gppi(sesskey, "BugIgnore1", BUG_AUTO, &cfg->sshbug_ignore1);
+    gppi(sesskey, "BugPlainPW1", BUG_AUTO, &cfg->sshbug_plainpw1);
+    gppi(sesskey, "BugRSA1", BUG_AUTO, &cfg->sshbug_rsa1);
+    {
+       int i;
+       gppi(sesskey, "BugHMAC2", BUG_AUTO, &cfg->sshbug_hmac2);
+       if (cfg->sshbug_hmac2 == BUG_AUTO) {
+           gppi(sesskey, "BuggyMAC", 0, &i);
+           if (i == 1)
+               cfg->sshbug_hmac2 = BUG_ON;
+       }
+    }
+    gppi(sesskey, "BugDeriveKey2", BUG_AUTO, &cfg->sshbug_derivekey2);
+    gppi(sesskey, "BugRSAPad2", BUG_AUTO, &cfg->sshbug_rsapad2);
+    gppi(sesskey, "BugDHGEx2", BUG_AUTO, &cfg->sshbug_dhgex2);
 
     close_settings_r(sesskey);
 }