1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 11:15:51 +00:00

Improved S/MIME error message

This commit is contained in:
M66B 2020-05-26 10:29:53 +02:00
parent 1fe1ef6407
commit c7f5f4d3b8

View file

@ -5500,10 +5500,12 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
}
// Check signature
boolean matching = false;
Store store = signedData.getCertificates();
SignerInformationStore signerInfos = signedData.getSignerInfos();
for (SignerInformation signer : signerInfos.getSigners()) {
for (Object match : store.getMatches(signer.getSID())) {
matching = true;
X509CertificateHolder certHolder = (X509CertificateHolder) match;
X509Certificate cert = new JcaX509CertificateConverter()
.getCertificate(certHolder);
@ -5654,6 +5656,12 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
break;
}
if (result == null)
args.putString("reason", matching
? "Signature could not be verified"
: "Certificates and signatures do not match");
if (is != null)
decodeMessage(context, is, message, args);
} else {