Commit eeba9a9b authored by Kevin J. McCarthy's avatar Kevin J. McCarthy

Fix s/mime non-detached signature handling.

This fix is based on stbuehler's patch from

Recent versions of gpgme seem to terminate the connection for a
protocol error.  stbuehler's analysis is that this is actually a
gpgme bug, but recreating the context works around the problem.
parent 9eeb406b
......@@ -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;
ctx = create_gpgme_context (is_smime);
/* 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 gpgme+gpgsm
* appear to end the session after an error */
gpgme_release (ctx);
goto restart;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment