mirror of https://github.com/M66B/FairEmail.git
Improved S/MIME error message
This commit is contained in:
parent
1fe1ef6407
commit
c7f5f4d3b8
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue