mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Throw NoSuchMessageException if attachment is invalid.
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
package org.briarproject.briar.api.attachment;
|
||||
|
||||
import org.briarproject.bramble.api.db.DbException;
|
||||
import org.briarproject.bramble.api.db.NoSuchMessageException;
|
||||
|
||||
public interface AttachmentReader {
|
||||
|
||||
/**
|
||||
* Returns the attachment with the given attachment header.
|
||||
*
|
||||
* @throws InvalidAttachmentException If the header refers to a message
|
||||
* @throws NoSuchMessageException If the header refers to a message in
|
||||
* a different group from the one specified in the header, to a message
|
||||
* that is not an attachment, or to an attachment that does not have the
|
||||
* expected content type
|
||||
* expected content type. This is meant to prevent social engineering
|
||||
* attacks that use invalid attachment IDs to test whether messages exist
|
||||
* in the victim's database
|
||||
*/
|
||||
Attachment getAttachment(AttachmentHeader h) throws DbException;
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
package org.briarproject.briar.api.attachment;
|
||||
|
||||
import org.briarproject.bramble.api.db.DbException;
|
||||
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
|
||||
/**
|
||||
* An exception that is thrown when an {@link AttachmentHeader} is used to
|
||||
* load an {@link Attachment}, and the header refers to a message that is not
|
||||
* an attachment, or to an attachment that does not have the expected content
|
||||
* type.
|
||||
*/
|
||||
@NotNullByDefault
|
||||
public class InvalidAttachmentException extends DbException {
|
||||
public InvalidAttachmentException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public InvalidAttachmentException(Throwable t) {
|
||||
super(t);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user