X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=util%2Fcrypto.c;fp=util%2Fcrypto.c;h=9d3b6dad9d17e4b32f645d0d5c0a2fbbf9fddf48;hp=066dea6e1a0380fa8b3844380269669c987e90ab;hb=fccebbaeef1e4b6489425afb13f419543d53d285;hpb=29648a137c5807135ab168917b4a51d5e19e51c2 diff --git a/util/crypto.c b/util/crypto.c index 066dea6e..9d3b6dad 100644 --- a/util/crypto.c +++ b/util/crypto.c @@ -199,7 +199,7 @@ _notmuch_crypto_decrypt (bool *attempted, #if (GMIME_MAJOR_VERSION < 3) #if HAVE_GMIME_SESSION_KEYS gboolean oldgetsk = g_mime_crypto_context_get_retrieve_session_key (crypto_ctx); - gboolean newgetsk = (decrypt_result); + gboolean newgetsk = (decrypt == NOTMUCH_DECRYPT_TRUE && decrypt_result); if (newgetsk != oldgetsk) /* This could return an error, but we can't do anything about it, so ignore it */ g_mime_crypto_context_set_retrieve_session_key (crypto_ctx, newgetsk, NULL); @@ -212,7 +212,7 @@ _notmuch_crypto_decrypt (bool *attempted, #endif #else GMimeDecryptFlags flags = GMIME_DECRYPT_NONE; - if (decrypt_result) + if (decrypt == NOTMUCH_DECRYPT_TRUE && decrypt_result) flags |= GMIME_DECRYPT_EXPORT_SESSION_KEY; ret = g_mime_multipart_encrypted_decrypt(part, flags, NULL, decrypt_result, err);