summaryrefslogtreecommitdiffstats
path: root/crypt.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2018-01-11 13:24:30 -0800
committerKevin McCarthy <kevin@8t8.us>2018-01-11 13:24:30 -0800
commitdb252e61ca2e41215ef9714e37b4340cd6eebe38 (patch)
tree75bf7b94e6a55c0e9f28935fc7812c8938ed1a9c /crypt.c
parentbe68a00c5d98712d6918cacc5f6456254bd23772 (diff)
Create pgp and s/mime default and sign_as key vars. (see #3983)
The $postpone_encrypt and $(pgp/smime)_self_encrypt configuration variables have created a somewhat messier situation for users. Many of them now have to specify their keys across multiple configuration variables. (Trac) Ticket #3983 had a reasonable request: "if my encrypt and signing keys are the same, why can't I just specify my key once in my .muttrc?" The problem currently is that $smime_default_key and $pgp_sign_as are both used to specify signing keys, and are set by the "sign (a)s" security menu choice. So we can't store encryption keys there because some users have separate sign-only capability keys. Create $pgp_default_key to store the default encryption key. Change signing to use $pgp_default_key, unless overridden by $pgp_sign_as. The pgp "sign (a)s" will continue setting $pgp_sign_as. Create $smime_sign_as. Change signing to use $smime_default_key unless overridden by $smime_sign_as. Change s/mime "sign (a)s" menu to set $smime_sign_as instead. Change $postpone_encrypt and $(pgp/smime)_self_encrypt to use $(pgp/smime)_default_key by default. Mark $(pgp/smime)_self_encrypt_as deprecated. They are now aliases for the $(pgp/smime)_default_key config vars. Change $(pgp/smime)_self_encrypt default to set. The intent is that most users now need only set $(pgp/smime)_default_key. If they have a sign-only key, or have separate signing and encryption keys, they can put that in $(pgp/smime)_sign_as. This also enables to default self_encrypt on and solve a very common request. Thanks to Michele Marcionelli and Vincent Lefèvre for gently pushing me towards a solution.
Diffstat (limited to 'crypt.c')
-rw-r--r--crypt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypt.c b/crypt.c
index 19a585d0..ab82ab92 100644
--- a/crypt.c
+++ b/crypt.c
@@ -832,7 +832,7 @@ int crypt_get_keys (HEADER *msg, char **keylist, int oppenc_mode)
}
unset_option (OPTPGPCHECKTRUST);
if (option (OPTPGPSELFENCRYPT))
- self_encrypt = PgpSelfEncryptAs;
+ self_encrypt = PgpDefaultKey;
}
if ((WithCrypto & APPLICATION_SMIME)
&& (msg->security & APPLICATION_SMIME))
@@ -843,7 +843,7 @@ int crypt_get_keys (HEADER *msg, char **keylist, int oppenc_mode)
return (-1);
}
if (option (OPTSMIMESELFENCRYPT))
- self_encrypt = SmimeSelfEncryptAs;
+ self_encrypt = SmimeDefaultKey;
}
}