From: Kevin McCarthy Date: Sun, 1 Jan 2017 03:57:07 +0000 (-0800) Subject: Canonicalize line endings for GPGME S/MIME encryption. (closes #3904) X-Git-Tag: neomutt-20170225~33^2~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9a6fb311e8ec06110e1057c59d8686073ecea059;p=neomutt Canonicalize line endings for GPGME S/MIME encryption. (closes #3904) This matches the behavior for S/MIME classic mode: OpenSSL converts the line endings to cr/lf before encrypting. Although Mutt always canonicalizes the line endings before verifying the signature, some clients do not do this for encrypted messages. Thanks to cooler for the patch! --- diff --git a/crypt-gpgme.c b/crypt-gpgme.c index f24ccda01..35f9cd5c1 100644 --- a/crypt-gpgme.c +++ b/crypt-gpgme.c @@ -1107,7 +1107,11 @@ BODY *smime_gpgme_build_smime_entity (BODY *a, char *keylist) if (!rset) return NULL; - plaintext = body_to_data_object (a, 0); + /* OpenSSL converts line endings to crlf when encrypting. Some + * clients depend on this for signed+encrypted messages: they do not + * convert line endings between decrypting and checking the + * signature. See #3904. */ + plaintext = body_to_data_object (a, 1); if (!plaintext) { free_recipient_set (&rset);