Fixed S/MIME canonicalization

This commit is contained in:
M66B 2021-09-18 13:15:47 +02:00
parent 3a4ea76b4f
commit a9e635b997
3 changed files with 8 additions and 3 deletions

View File

@ -2,10 +2,11 @@
### [Yaverlandia](https://en.wikipedia.org/wiki/Yaverlandia)
### 1.1726b
### 1.1726c
* Following dark/light theme for original message view
* Added message menu item / optional button to force light theme for original message view
* Fixed verifying some S/MIME signatures
### 1.1726

View File

@ -4,7 +4,7 @@ apply plugin: 'kotlin-android'
apply plugin: 'de.undercouch.download'
def getVersionCode = { -> return 1726 }
def getRevision = { -> "\"c\"" }
def getRevision = { -> "\"d\"" }
def getReleaseName = { -> return "\"Yaverlandia\"" }
// https://en.wikipedia.org/wiki/List_of_dinosaur_genera

View File

@ -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());
}