Support for selecting AES from the GUI. In the process, I've had to
[u/mdw/putty] / settings.c
index 0a7f211..ad062dd 100644 (file)
@@ -42,7 +42,7 @@ void save_settings (char *section, int do_host, Config *cfg) {
             }
         write_setting_s (sesskey, "Protocol", p);
     }
-    write_setting_i (sesskey, "CloseOnExit", !!cfg->close_on_exit);
+    write_setting_i (sesskey, "CloseOnExit", cfg->close_on_exit);
     write_setting_i (sesskey, "WarnOnClose", !!cfg->warn_on_close);
     write_setting_i (sesskey, "PingInterval", cfg->ping_interval / 60);     /* minutes */
     write_setting_i (sesskey, "PingIntervalSecs", cfg->ping_interval % 60); /* seconds */
@@ -73,8 +73,11 @@ void save_settings (char *section, int do_host, Config *cfg) {
     write_setting_i (sesskey, "Compression", cfg->compression);
     write_setting_i (sesskey, "AgentFwd", cfg->agentfwd);
     write_setting_s (sesskey, "RemoteCmd", cfg->remote_cmd);
-    write_setting_s (sesskey, "Cipher", cfg->cipher == CIPHER_BLOWFISH ? "blowfish" :
-                             cfg->cipher == CIPHER_DES ? "des" : "3des");
+    write_setting_s (sesskey, "Cipher",
+                     cfg->cipher == CIPHER_BLOWFISH ? "blowfish" :
+                     cfg->cipher == CIPHER_DES ? "des" :
+                     cfg->cipher == CIPHER_AES ? "aes" :
+                     "3des");
     write_setting_i (sesskey, "AuthTIS", cfg->try_tis_auth);
     write_setting_i (sesskey, "SshProt", cfg->sshprot);
     write_setting_i (sesskey, "BuggyMAC", cfg->buggymac);
@@ -93,7 +96,8 @@ void save_settings (char *section, int do_host, Config *cfg) {
     write_setting_i (sesskey, "AltSpace", cfg->alt_space);
     write_setting_i (sesskey, "AltOnly", cfg->alt_only);
     write_setting_i (sesskey, "ComposeKey", cfg->compose_key);
-    write_setting_i (sesskey, "LdiscTerm", cfg->ldisc_term);
+    write_setting_i (sesskey, "LocalEcho", cfg->localecho);
+    write_setting_i (sesskey, "LocalEdit", cfg->localedit);
     write_setting_i (sesskey, "AlwaysOnTop", cfg->alwaysontop);
     write_setting_i (sesskey, "HideMousePtr", cfg->hide_mouseptr);
     write_setting_i (sesskey, "CurType", cfg->cursor_type);
@@ -156,6 +160,8 @@ void load_settings (char *section, int do_host, Config *cfg) {
 
     sesskey = open_settings_r(section);
 
+    cfg->ssh_subsys = 0;               /* FIXME: load this properly */
+
     gpps (sesskey, "HostName", "", cfg->host, sizeof(cfg->host));
     gppi (sesskey, "PortNumber", default_port, &cfg->port);
     gpps (sesskey, "LogFileName", "putty.log",
@@ -170,7 +176,7 @@ void load_settings (char *section, int do_host, Config *cfg) {
             break;
         }
 
-    gppi (sesskey, "CloseOnExit", 1, &cfg->close_on_exit);
+    gppi (sesskey, "CloseOnExit", COE_NORMAL, &cfg->close_on_exit);
     gppi (sesskey, "WarnOnClose", 1, &cfg->warn_on_close);
     {
       /* This is two values for backward compatibility with 0.50/0.51 */
@@ -215,6 +221,8 @@ void load_settings (char *section, int do_host, Config *cfg) {
            cfg->cipher = CIPHER_BLOWFISH;
        else if (!strcmp(cipher, "des"))
            cfg->cipher = CIPHER_DES;
+       else if (!strcmp(cipher, "aes"))
+           cfg->cipher = CIPHER_AES;
        else
            cfg->cipher = CIPHER_3DES;
     }
@@ -237,7 +245,8 @@ void load_settings (char *section, int do_host, Config *cfg) {
     gppi (sesskey, "AltSpace", 0, &cfg->alt_space);
     gppi (sesskey, "AltOnly", 0, &cfg->alt_only);
     gppi (sesskey, "ComposeKey", 0, &cfg->compose_key);
-    gppi (sesskey, "LdiscTerm", 0, &cfg->ldisc_term);
+    gppi (sesskey, "LocalEcho", LD_BACKEND, &cfg->localecho);
+    gppi (sesskey, "LocalEdit", LD_BACKEND, &cfg->localedit);
     gppi (sesskey, "AlwaysOnTop", 0, &cfg->alwaysontop);
     gppi (sesskey, "HideMousePtr", 0, &cfg->hide_mouseptr);
     gppi (sesskey, "CurType", 0, &cfg->cursor_type);