aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2019-05-02 09:19:37 -0400
committerDavid Bremner <david@tethera.net>2019-05-03 06:55:32 -0300
commitbb0b119358e4d6df5cc085a48cb3d2e09e396922 (patch)
tree2eacba32eb5e35bdc3a8e3b7fcd75bf662c70c0f /lib
parent096d45a878ba9606f1677f66d346b14c3c274fa5 (diff)
gmime-cleanup: always support session keys
Our minimum version of GMime 3.0 always supports good session key handling. signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/built-with.c2
-rw-r--r--lib/index.cc4
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/built-with.c b/lib/built-with.c
index 9cffd9f9..320be6c5 100644
--- a/lib/built-with.c
+++ b/lib/built-with.c
@@ -31,7 +31,7 @@ notmuch_built_with (const char *name)
} else if (STRNCMP_LITERAL (name, "retry_lock") == 0) {
return HAVE_XAPIAN_DB_RETRY_LOCK;
} else if (STRNCMP_LITERAL (name, "session_key") == 0) {
- return HAVE_GMIME_SESSION_KEYS;
+ return true;
} else {
return false;
}
diff --git a/lib/index.cc b/lib/index.cc
index 0e98984c..6b6fbb8f 100644
--- a/lib/index.cc
+++ b/lib/index.cc
@@ -531,7 +531,7 @@ _index_encrypted_mime_part (notmuch_message_t *message,
GMimeCryptoContext* crypto_ctx = NULL;
bool attempted = false;
GMimeDecryptResult *decrypt_result = NULL;
- bool get_sk = (HAVE_GMIME_SESSION_KEYS && notmuch_indexopts_get_decrypt_policy (indexopts) == NOTMUCH_DECRYPT_TRUE);
+ bool get_sk = (notmuch_indexopts_get_decrypt_policy (indexopts) == NOTMUCH_DECRYPT_TRUE);
clear = _notmuch_crypto_decrypt (&attempted, notmuch_indexopts_get_decrypt_policy (indexopts),
message, crypto_ctx, encrypted_data, get_sk ? &decrypt_result : NULL, &err);
if (!attempted)
@@ -554,7 +554,6 @@ _index_encrypted_mime_part (notmuch_message_t *message,
return;
}
if (decrypt_result) {
-#if HAVE_GMIME_SESSION_KEYS
if (get_sk) {
status = notmuch_message_add_property (message, "session-key",
g_mime_decrypt_result_get_session_key (decrypt_result));
@@ -562,7 +561,6 @@ _index_encrypted_mime_part (notmuch_message_t *message,
_notmuch_database_log (notmuch, "failed to add session-key "
"property (%d)\n", status);
}
-#endif
g_object_unref (decrypt_result);
}
_index_mime_part (message, indexopts, clear);