On Wed, Mar 21, 2018 at 10:56:22AM -0700, Kevin J. McCarthy wrote:
> If you feel comfortable patching and testing, I'd appreciate to know if
> that fixes it for you.  Regardless, I will take a closer look and apply
> that patch myself later today.

Hi Michael,

I'm attaching a patch that's just a slightly different version of the
one I mentioned.  It's against stable, but should apply to master with
just a warning about a 5-line offset.  If you could try it out, I'd
appreciate it.

Thank you,

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
diff --git a/crypt-gpgme.c b/crypt-gpgme.c
index 7283e109..35852380 100644
--- a/crypt-gpgme.c
+++ b/crypt-gpgme.c
@@ -1685,9 +1685,9 @@ static BODY *decrypt_part (BODY *a, STATE *s, FILE *fpout, int is_smime,
   if (r_is_signed)
     *r_is_signed = 0;
 
+restart:
   ctx = create_gpgme_context (is_smime);
 
- restart:
   /* Make a data object from the body, create context etc. */
   ciphertext = file_to_data_object (s->fpin, a->offset, a->length);
   if (!ciphertext)
@@ -1730,6 +1730,9 @@ static BODY *decrypt_part (BODY *a, STATE *s, FILE *fpout, int is_smime,
             {
               maybe_signed = 1;
               gpgme_data_release (plaintext);
+              /* We release the context because recent versions of gpgsm
+               * appear to end the session after an error */
+              gpgme_release (ctx);
               goto restart;
             }
         }

Attachment: signature.asc
Description: PGP signature

Reply via email to