Bug 392167 - Newlines in MIME parsing cause S/MIME signature to fail
Summary: Newlines in MIME parsing cause S/MIME signature to fail
Status: REPORTED
Alias: None
Product: kmail2
Classification: Applications
Component: crypto (show other bugs)
Version: 5.7.2
Platform: Archlinux Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-22 10:28 UTC by Michał Goliński
Modified: 2018-03-22 10:34 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
A failing email saved form KMail. (215.84 KB, application/mbox)
2018-03-22 10:32 UTC, Michał Goliński
Details
The same email when save from thunderbird (218.67 KB, message/rfc822)
2018-03-22 10:34 UTC, Michał Goliński
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Goliński 2018-03-22 10:28:08 UTC
KMail mangles newlines in a multipart message. This causes siganture verification to fail.

I believe this is caused by parts in multipart messages that do not end with a newline.

The attached file shows the problem. It is a message that has the following structure:

multipart/signed
    multipart/mixed
        multipart/related
            text/html
            image/jpeg
            image/jpeg
            image/jpeg
            image/jpeg
            image/jpeg
            image/jpeg
            image/jpeg
            image/jpeg
            image/jpeg
            image/jpeg
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
        application/pdf
    application/pkcs7-signature

KMail adds a newline after the end boundary of multipart/related and before the boundary of multipart/mixed (in the marked place).
Comment 1 Michał Goliński 2018-03-22 10:32:39 UTC
Created attachment 111553 [details]
A failing email saved form KMail.

Note the spurious newline at line 2157.
Comment 2 Michał Goliński 2018-03-22 10:34:08 UTC
Created attachment 111554 [details]
The same email when save from thunderbird

Note that there is no blank line at line 2154