summaryrefslogtreecommitdiffstats
path: root/crypt-gpgme.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2019-07-21 15:15:06 -0700
committerKevin McCarthy <kevin@8t8.us>2019-08-03 14:08:09 -0700
commit963fc1ba4795ec65083741adf7b649d997fd58b7 (patch)
tree3d4d2365fc48a3231e4ecfa8633fff2142c4ceb7 /crypt-gpgme.c
parent959628d079b6efaa9c724f9be83af3d6061fdae4 (diff)
Autocrypt outgoing emails.
Change crypt_get_keys() to query autocrypt. When oppenc_mode is set, we still query the original keyring regardless, because the compose menu can still run oppenc even if autocrypt is on. Since mutt_autocrypt_ui_recommendation() checks each key as part of making the recommendation, add a keylist parameter and use that function. Add gpgme changes to use the autocrypt context for encryption. Postpone work: * Change mutt_protect() to have a postpone parameter. Remove the manual toggling of the SIGN bit outside the call when postponing. * Since autocrypt doesn't set the SIGN bit, this allows us to turn off signing inside mutt_protect() for both normal and autocrypt mode. * Set the autocrypt postpone key in AutocryptDefaultKey. Write autocrypt and gossip headers in outgoing emails.
Diffstat (limited to 'crypt-gpgme.c')
-rw-r--r--crypt-gpgme.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/crypt-gpgme.c b/crypt-gpgme.c
index bbdede5f..83f6ae6a 100644
--- a/crypt-gpgme.c
+++ b/crypt-gpgme.c
@@ -564,6 +564,13 @@ static gpgme_ctx_t create_gpgme_context (int for_smime)
gpgme_ctx_t ctx;
err = gpgme_new (&ctx);
+
+#ifdef USE_AUTOCRYPT
+ if (!err && option (OPTAUTOCRYPTGPGME))
+ err = gpgme_ctx_set_engine_info (ctx, GPGME_PROTOCOL_OpenPGP, NULL,
+ AutocryptDir);
+#endif
+
if (err)
{
mutt_error (_("error creating gpgme context: %s\n"), gpgme_strerror (err));
@@ -944,6 +951,10 @@ static int set_signer (gpgme_ctx_t ctx, int for_smime)
if (for_smime)
signid = SmimeSignAs ? SmimeSignAs : SmimeDefaultKey;
+#ifdef USE_AUTOCRYPT
+ else if (option (OPTAUTOCRYPTGPGME))
+ signid = AutocryptSignAs;
+#endif
else
signid = PgpSignAs ? PgpSignAs : PgpDefaultKey;