mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-29 13:24:52 +02:00
Fixed S/MIME canonicalization
This commit is contained in:
@@ -2333,9 +2333,13 @@ public class MessageHelper {
|
||||
if (parts.length < 2)
|
||||
throw new ParseException("Signed part missing");
|
||||
|
||||
// PGP: https://datatracker.ietf.org/doc/html/rfc3156#section-5
|
||||
// S/MIME: https://datatracker.ietf.org/doc/html/rfc8551#section-3.1.1
|
||||
String c = parts[1]
|
||||
.replaceAll(" +$", "") // trim trailing spaces
|
||||
.replaceAll("\\r?\\n", "\r\n"); // normalize new lines
|
||||
if (EntityAttachment.PGP_CONTENT.equals(apart.encrypt))
|
||||
c = c.replaceAll(" +$", ""); // trim trailing spaces
|
||||
|
||||
try (OutputStream os = new FileOutputStream(file)) {
|
||||
os.write(c.getBytes());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user