Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ce249bf0 authored by Vincent Breitmoser's avatar Vincent Breitmoser
Browse files

convert LF newlines to CRLF in crypto provider output

OpenKeychain/BouncyCastle at this point use the system newline for
formatting, which is LF on android.  We need this to be CRLF, so we
convert the data after receiving (and possibly before quoted-printable
encoding).
parent c7b5a506
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import com.fsck.k9.mail.Body;
import com.fsck.k9.mail.BodyPart;
import com.fsck.k9.mail.BoundaryGenerator;
import com.fsck.k9.mail.MessagingException;
import com.fsck.k9.mail.filter.EOLConvertingOutputStream;
import com.fsck.k9.mail.internet.BinaryTempFileBody;
import com.fsck.k9.mail.internet.MessageIdGenerator;
import com.fsck.k9.mail.internet.MimeBodyPart;
@@ -193,6 +194,9 @@ public class PgpMessageBuilder extends MessageBuilder {
                pgpResultTempBody = new BinaryTempFileBody(
                        capturedOutputPartIs7Bit ? MimeUtil.ENC_7BIT : MimeUtil.ENC_8BIT);
                outputStream = pgpResultTempBody.getOutputStream();
                // OpenKeychain/BouncyCastle at this point use the system newline for formatting, which is LF on android.
                // we need this to be CRLF, so we convert the data after receiving.
                outputStream = new EOLConvertingOutputStream(outputStream);
            } catch (IOException e) {
                throw new MessagingException("could not allocate temp file for storage!", e);
            }