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:
parent
1fe1ef6407
commit
c7f5f4d3b8
1 changed files with 8 additions and 0 deletions
|
@ -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 a new issue