From: simon Date: Sat, 25 Aug 2001 20:01:36 +0000 (+0000) Subject: Fiddle with the registry format so that backwards compatibility is X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/e411be57d308435211810fd9385ac47fb95d616f Fiddle with the registry format so that backwards compatibility is natural and defaults are sensible. git-svn-id: svn://svn.tartarus.org/sgt/putty@1200 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/settings.c b/settings.c index 53e89591..93e50893 100644 --- a/settings.c +++ b/settings.c @@ -14,10 +14,10 @@ struct keyval { char *s; int v; }; static const struct keyval ciphernames[] = { - { "WARN", CIPHER_WARN }, - { "3des", CIPHER_3DES }, - { "blowfish", CIPHER_BLOWFISH }, { "aes", CIPHER_AES }, + { "blowfish", CIPHER_BLOWFISH }, + { "3des", CIPHER_3DES }, + { "WARN", CIPHER_WARN }, { "des", CIPHER_DES } }; @@ -171,7 +171,7 @@ void save_settings(char *section, int do_host, Config * cfg) write_setting_i(sesskey, "NoPTY", cfg->nopty); write_setting_i(sesskey, "Compression", cfg->compression); write_setting_i(sesskey, "AgentFwd", cfg->agentfwd); - wprefs(sesskey, "SSHCipherList", ciphernames, CIPHER_MAX, + wprefs(sesskey, "Cipher", ciphernames, CIPHER_MAX, cfg->ssh_cipherlist); write_setting_i(sesskey, "AuthTIS", cfg->try_tis_auth); write_setting_i(sesskey, "SshProt", cfg->sshprot); @@ -342,19 +342,8 @@ void load_settings(char *section, int do_host, Config * cfg) gppi(sesskey, "NoPTY", 0, &cfg->nopty); gppi(sesskey, "Compression", 0, &cfg->compression); gppi(sesskey, "AgentFwd", 0, &cfg->agentfwd); - { - /* Backwards compatibility: recreate old cipher policy. */ - char defcipherlist[80]; - gpps(sesskey, "Cipher", "3des", defcipherlist, 80); - if (strcmp(defcipherlist, "3des") != 0) { - int l = strlen(defcipherlist); - strncpy(defcipherlist + l, ",3des", 80 - l); - defcipherlist[79] = '\0'; - } - /* Use it as default if no new-style policy. */ - gprefs(sesskey, "SSHCipherList", defcipherlist, - ciphernames, CIPHER_MAX, cfg->ssh_cipherlist); - } + gprefs(sesskey, "Cipher", "\0", + ciphernames, CIPHER_MAX, cfg->ssh_cipherlist); gppi(sesskey, "SshProt", 1, &cfg->sshprot); gppi(sesskey, "BuggyMAC", 0, &cfg->buggymac); gppi(sesskey, "AuthTIS", 0, &cfg->try_tis_auth);