diff --git a/briar-core/src/main/java/org/briarproject/briar/remotewipe/RemoteWipeManagerImpl.java b/briar-core/src/main/java/org/briarproject/briar/remotewipe/RemoteWipeManagerImpl.java index 437953847..500c8b98a 100644 --- a/briar-core/src/main/java/org/briarproject/briar/remotewipe/RemoteWipeManagerImpl.java +++ b/briar-core/src/main/java/org/briarproject/briar/remotewipe/RemoteWipeManagerImpl.java @@ -197,10 +197,10 @@ public class RemoteWipeManagerImpl extends ConversationClientImpl // Send a CONFIRM message to each wiper sendConfirmMessages(txn); - if (observer != null) { - observer.onPanic(); - } - txn.attach(new RemoteWipeActivatedEvent()); +// if (observer != null) { +// observer.onPanic(); +// } +// txn.attach(new RemoteWipeActivatedEvent()); // we could here clear the metadata to allow us to send // the wipe messages several times when testing @@ -233,6 +233,7 @@ public class RemoteWipeManagerImpl extends ConversationClientImpl clientHelper .mergeGroupMetadata(txn, localGroup.getId(), localRecord); } else if (type == CONFIRM) { + LOG.info("*** Got confirm msg"); messageTracker.trackIncomingMessage(txn, m); ContactId contactId = getContactId(txn, m.getGroupId()); diff --git a/briar-core/src/main/java/org/briarproject/briar/remotewipe/RemoteWipeValidator.java b/briar-core/src/main/java/org/briarproject/briar/remotewipe/RemoteWipeValidator.java index 91d9e487e..6d0d7e004 100644 --- a/briar-core/src/main/java/org/briarproject/briar/remotewipe/RemoteWipeValidator.java +++ b/briar-core/src/main/java/org/briarproject/briar/remotewipe/RemoteWipeValidator.java @@ -17,6 +17,7 @@ import javax.annotation.concurrent.Immutable; import javax.inject.Inject; import static org.briarproject.bramble.util.ValidationUtils.checkSize; +import static org.briarproject.briar.api.remotewipe.MessageType.CONFIRM; import static org.briarproject.briar.api.remotewipe.MessageType.REVOKE; import static org.briarproject.briar.api.remotewipe.MessageType.SETUP; import static org.briarproject.briar.api.remotewipe.MessageType.WIPE; @@ -42,6 +43,7 @@ class RemoteWipeValidator extends BdfMessageValidator { if (type == SETUP) return validateSetupMessage(body); else if (type == WIPE) return validateWipeMessage(body); else if (type == REVOKE) return validateRevokeMessage(body); + else if (type == CONFIRM) return validateConfirmMessage(body); else throw new AssertionError(); } @@ -71,4 +73,13 @@ class RemoteWipeValidator extends BdfMessageValidator { new BdfEntry(MSG_KEY_LOCAL, false)); return new BdfMessageContext(meta); } + + private BdfMessageContext validateConfirmMessage(BdfList body) + throws FormatException { + checkSize(body, 1); + BdfDictionary meta = BdfDictionary.of( + new BdfEntry(MSG_KEY_MESSAGE_TYPE, CONFIRM.getValue()), + new BdfEntry(MSG_KEY_LOCAL, false)); + return new BdfMessageContext(meta); + } }