diff options
author | Kevin McCarthy <kevin@8t8.us> | 2020-02-02 15:10:34 -0800 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2020-02-29 19:15:09 -0800 |
commit | d3d0f3a23dfac4c326f68cdc99430858e2572198 (patch) | |
tree | faa1006c1849b63f3cd4ac47d32a7cadecc0d3ec /crypt-gpgme.c | |
parent | 093cc268e9e812ca647f6edfcf8028dff9b62650 (diff) |
Change send_menus to set sctx instead of globals.
Add a "cleared" bit for smime_crypt_alg. Otherwise clearing the value
in smime.c's menu would cause the compose menu and mutt_protect() to
fall back to using SmimeCryptAlg.
Diffstat (limited to 'crypt-gpgme.c')
-rw-r--r-- | crypt-gpgme.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/crypt-gpgme.c b/crypt-gpgme.c index 488ac665..774d5a23 100644 --- a/crypt-gpgme.c +++ b/crypt-gpgme.c @@ -5271,13 +5271,16 @@ void smime_gpgme_init (void) init_smime (); } -static int gpgme_send_menu (HEADER *msg, int is_smime) +static void gpgme_send_menu (SEND_CONTEXT *sctx, int is_smime) { + HEADER *msg; crypt_key_t *p; char input_signas[SHORT_STRING]; char *prompt, *letters, *choices; int choice; + msg = sctx->msg; + if (is_smime) msg->security |= APPLICATION_SMIME; else @@ -5371,7 +5374,8 @@ static int gpgme_send_menu (HEADER *msg, int is_smime) { snprintf (input_signas, sizeof (input_signas), "0x%s", crypt_fpr_or_lkeyid (p)); - mutt_str_replace (is_smime? &SmimeSignAs : &PgpSignAs, input_signas); + mutt_str_replace (is_smime? &sctx->smime_sign_as : &sctx->pgp_sign_as, + input_signas); crypt_free_key (&p); msg->security |= SIGN; @@ -5418,18 +5422,16 @@ static int gpgme_send_menu (HEADER *msg, int is_smime) break; } } - - return (msg->security); } -int pgp_gpgme_send_menu (HEADER *msg) +void pgp_gpgme_send_menu (SEND_CONTEXT *sctx) { - return gpgme_send_menu (msg, 0); + gpgme_send_menu (sctx, 0); } -int smime_gpgme_send_menu (HEADER *msg) +void smime_gpgme_send_menu (SEND_CONTEXT *sctx) { - return gpgme_send_menu (msg, 1); + gpgme_send_menu (sctx, 1); } static int verify_sender (HEADER *h, gpgme_protocol_t protocol) |