Skip to content
Snippets Groups Projects
Commit 75e7fa58 authored by bontric's avatar bontric
Browse files

remove contactId from TAKE request (contactId is identified by reading

the tag from the encrypted stream)
parent 1305a5b1
No related branches found
No related tags found
No related merge requests found
......@@ -5,12 +5,10 @@ import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.data.BdfList;
public class MailboxRequestTake extends MailboxRequest {
private ContactId contactId;
private byte[] encryptedSyncStream = null;
public MailboxRequestTake(ContactId contactId, byte[] encryptedSyncStream) {
public MailboxRequestTake(byte[] encryptedSyncStream) {
super(TYPE.TAKE);
this.contactId = contactId;
this.encryptedSyncStream = encryptedSyncStream;
}
......@@ -20,7 +18,7 @@ public class MailboxRequestTake extends MailboxRequest {
@Override
protected BdfList getRequestBody() {
return BdfList.of(contactId.getInt(), encryptedSyncStream);
return BdfList.of(encryptedSyncStream);
}
@Override
......@@ -30,20 +28,12 @@ public class MailboxRequestTake extends MailboxRequest {
@Override
public void parseBody(BdfList msg) throws FormatException {
Long cId = msg.getLong(0);
if (cId > Integer.MAX_VALUE || cId < Integer.MIN_VALUE)
throw new FormatException();
this.contactId = new ContactId(cId.intValue());
this.encryptedSyncStream = msg.getRaw(1);
this.encryptedSyncStream = msg.getRaw(0);
}
public byte[] getEncryptedSyncStream() {
return encryptedSyncStream;
}
public ContactId getContactId() {
return contactId;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment