Skip to content

Conversation

@PommesSchranke
Copy link

@PommesSchranke PommesSchranke commented Jun 5, 2021

MIME::QuotedPrint::qp_decode destroys the signatures of signed PDF files with mixed line endings (some encoded, some not, some "\n" some "\r\n") and is therefore not usable in professional workflows. It does so, by enforcing some “standard” on EOLs that does not really exist (or that is badly defined and prone to misunderstandings).

The first commit on this branch adds a test to demonstrate the problem, the second one implements the fix. The module now goes with the EOL the users supplied (and therefor intended), if in doubt (i.e. no encoded EOL was found on that line). And, as a result, saves the electronic signatures from deterioration (which is a widely known problem).

Just for the fun of it: This is the bug report I submitted quite a while ago: https://rt.cpan.org/Public/Bug/Display.html?id=128456

Note, that the fix is installed on secure-Mail servers in production since quite a while now (in fact, I had to implement some quirky workaround to replace the buggy qp_decode: https://gitlab.com/ChipsBarrier/mime-quotedprintmscompat). In that environment, signed content is part of about 50% of the mails going through the system. The fix stopped the customer complaints for good.

Destroying user content is a Bug.

Outlook attaches PDF files quoted printable encoded. That's another bug, but we cannot fix it.
A third bug is the way electronical documents are normalized before signing/verification. We cannot fix that either.

Sebastian Rose, Hannover, Germany added 2 commits January 9, 2025 21:24
The strategy is, to not change user supplied eols when
decoding.  If an encoded eol was found, use it.  If not,
go with the one the user gave us.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant