1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-27 08:23:24 +00:00

Check S/MIME content availability

This commit is contained in:
M66B 2019-12-02 14:31:44 +01:00
parent 031eeacd58
commit e30f6be596

View file

@ -4379,10 +4379,15 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
File signature = null;
List<EntityAttachment> attachments = db.attachment().getAttachments(id);
for (EntityAttachment attachment : attachments)
if (EntityAttachment.SMIME_SIGNATURE.equals(attachment.encryption))
if (EntityAttachment.SMIME_SIGNATURE.equals(attachment.encryption)) {
if (!attachment.available)
throw new IllegalArgumentException(context.getString(R.string.title_attachments_missing));
signature = attachment.getFile(context);
else if (EntityAttachment.SMIME_CONTENT.equals(attachment.encryption))
} else if (EntityAttachment.SMIME_CONTENT.equals(attachment.encryption)) {
if (!attachment.available)
throw new IllegalArgumentException(context.getString(R.string.title_attachments_missing));
content = attachment.getFile(context);
}
if (content == null)
throw new IllegalArgumentException("Signed content missing");
@ -4433,9 +4438,12 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
List<EntityAttachment> attachments = db.attachment().getAttachments(id);
for (EntityAttachment attachment : attachments)
if (EntityAttachment.SMIME_MESSAGE.equals(attachment.encryption)) {
if (!attachment.available)
throw new IllegalArgumentException(context.getString(R.string.title_attachments_missing));
input = attachment.getFile(context);
break;
}
if (input == null)
throw new IllegalArgumentException("Encrypted message missing");