mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-01 22:56:33 +02:00
Check S/MIME content availability
This commit is contained in:
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user