aboutsummaryrefslogtreecommitdiff
path: root/lib/indexopts.c
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2017-12-08 01:23:53 -0500
committerDavid Bremner <david@tethera.net>2017-12-08 08:07:53 -0400
commite4890b5bf9e2260b36bcc36ddb77d8e97e2abe7d (patch)
tree83c71b87a02c656aee698a5e10700a4ff6e12419 /lib/indexopts.c
parent798aa789b5d117cf11697bc97dd982bd5a2c2ac8 (diff)
crypto: new decryption policy "auto"
This new automatic decryption policy should make it possible to decrypt messages that we have stashed session keys for, without incurring a call to the user's asymmetric keys.
Diffstat (limited to 'lib/indexopts.c')
-rw-r--r--lib/indexopts.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/indexopts.c b/lib/indexopts.c
index 78f53391..a04d1c1c 100644
--- a/lib/indexopts.c
+++ b/lib/indexopts.c
@@ -33,11 +33,14 @@ notmuch_database_get_default_indexopts (notmuch_database_t *db)
if (err)
return ret;
- if (decrypt_policy &&
- ((!(strcasecmp(decrypt_policy, "true"))) ||
- (!(strcasecmp(decrypt_policy, "yes"))) ||
- (!(strcasecmp(decrypt_policy, "1")))))
- notmuch_indexopts_set_decrypt_policy (ret, NOTMUCH_DECRYPT_TRUE);
+ if (decrypt_policy) {
+ if ((!(strcasecmp(decrypt_policy, "true"))) ||
+ (!(strcasecmp(decrypt_policy, "yes"))) ||
+ (!(strcasecmp(decrypt_policy, "1"))))
+ notmuch_indexopts_set_decrypt_policy (ret, NOTMUCH_DECRYPT_TRUE);
+ else if (!strcasecmp(decrypt_policy, "auto"))
+ notmuch_indexopts_set_decrypt_policy (ret, NOTMUCH_DECRYPT_AUTO);
+ }
free (decrypt_policy);
return ret;