From d137170b23f8ccd9f967445e101d6f694df1cad4 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Fri, 8 Dec 2017 01:23:58 -0500 Subject: crypto: record whether an actual decryption attempt happened In our consolidation of _notmuch_crypto_decrypt, the callers lost track a little bit of whether any actual decryption was attempted. Now that we have the more-subtle "auto" policy, it's possible that _notmuch_crypto_decrypt could be called without having any actual decryption take place. This change lets the callers be a little bit smarter about whether or not any decryption was actually attempted. --- mime-node.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mime-node.c') diff --git a/mime-node.c b/mime-node.c index 49d668fe..11df082b 100644 --- a/mime-node.c +++ b/mime-node.c @@ -204,8 +204,8 @@ node_decrypt_and_verify (mime_node_t *node, GMimeObject *part, if (parent->envelope_file) break; - node->decrypt_attempted = true; - node->decrypted_child = _notmuch_crypto_decrypt (node->ctx->crypto->decrypt, + node->decrypted_child = _notmuch_crypto_decrypt (&node->decrypt_attempted, + node->ctx->crypto->decrypt, parent ? parent->envelope_file : NULL, cryptoctx, encrypteddata, &decrypt_result, &err); } -- cgit v1.2.3