X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=util%2Fcrypto.c;fp=util%2Fcrypto.c;h=338f1d5d85e5a4b9b273488dcac4b1770c301749;hp=bb587571879320f6370b320cf6e2083e2187503c;hb=d137170b23f8ccd9f967445e101d6f694df1cad4;hpb=181d4091c408b8ca014ec245ecdae602942b70ce diff --git a/util/crypto.c b/util/crypto.c index bb587571..338f1d5d 100644 --- a/util/crypto.c +++ b/util/crypto.c @@ -140,7 +140,8 @@ void _notmuch_crypto_cleanup (unused(_notmuch_crypto_t *crypto)) #endif GMimeObject * -_notmuch_crypto_decrypt (notmuch_decryption_policy_t decrypt, +_notmuch_crypto_decrypt (bool *attempted, + notmuch_decryption_policy_t decrypt, notmuch_message_t *message, g_mime_3_unused(GMimeCryptoContext* crypto_ctx), GMimeMultipartEncrypted *part, @@ -162,6 +163,8 @@ _notmuch_crypto_decrypt (notmuch_decryption_policy_t decrypt, g_error_free (*err); *err = NULL; } + if (attempted) + *attempted = true; #if (GMIME_MAJOR_VERSION < 3) ret = g_mime_multipart_encrypted_decrypt_session (part, crypto_ctx, @@ -191,6 +194,8 @@ _notmuch_crypto_decrypt (notmuch_decryption_policy_t decrypt, if (decrypt == NOTMUCH_DECRYPT_AUTO) return ret; + if (attempted) + *attempted = true; #if (GMIME_MAJOR_VERSION < 3) ret = g_mime_multipart_encrypted_decrypt(part, crypto_ctx, decrypt_result, err);