Skip to content
Snippets Groups Projects
Verified Commit 61a2c6d2 authored by Julian Dehm's avatar Julian Dehm
Browse files

tesdsa

parent f01e3fea
No related branches found
No related tags found
Loading
Checking pipeline status
......@@ -112,6 +112,7 @@ class IntroduceeProtocolEngine
private IntroduceeSession onRemoteRequest(Transaction txn,
IntroduceeSession s,
IntroduceeRequestMessage m) throws DbException {
LOG.info("OnRemoteRequest Introducee");
// The dependency, if any, must be the last remote message
if (isInvalidDependency(s, m.getPreviousMessageId()))
return abort(txn, s);
......@@ -229,6 +230,7 @@ class IntroduceeProtocolEngine
MailboxIntroductionSucceededEvent e =
new MailboxIntroductionSucceededEvent(c);
txn.attach(e);
LOG.info("Contact mailbox added");
} catch (GeneralSecurityException e) {
logException(LOG, WARNING, e);
return abort(txn, s);
......
......@@ -96,6 +96,7 @@ class MailboxProtocolEngine extends AbstractProtocolEngine<MailboxSession> {
private MailboxSession onRemoteRequest(Transaction txn, MailboxSession s,
RequestMessage m) throws DbException {
LOG.info("onRemoteREquest mailbox");
// The dependency, if any, must be the last remote message
if (isInvalidDependency(s, m.getPreviousMessageId()))
return abort(txn, s);
......@@ -244,6 +245,7 @@ class MailboxProtocolEngine extends AbstractProtocolEngine<MailboxSession> {
sendMailboxAuthMessage(txn, s, clock.currentTimeMillis(),
transportProperties, mac, signature,
s.getMessageCounter());
LOG.info("Contact from owner added");
//TODO: Check for reasons to decline and if any, move to LOCAL_DECLINE
return MailboxSession
.clear(s, CONTACT_ADDED, reply.getId(),
......
......@@ -19,6 +19,8 @@ import org.briarproject.briar.api.client.ProtocolStateException;
import org.briarproject.briar.api.mailbox.event.MailboxIntroductionResponseReceivedEvent;
import org.briarproject.briar.api.mailbox.event.MailboxIntroductionSucceededEvent;
import java.util.logging.Logger;
import javax.inject.Inject;
import static org.briarproject.briar.mailbox.OwnerState.ADDED;
......@@ -28,6 +30,7 @@ import static org.briarproject.briar.mailbox.OwnerState.AWAIT_RESPONSE_M;
class OwnerProtocolEngine extends AbstractProtocolEngine<OwnerSession> {
private static final Logger LOG =Logger.getLogger(OwnerProtocolEngine.class.getName());
@Inject
OwnerProtocolEngine(DatabaseComponent db, ClientHelper clientHelper,
ContactManager contactManager,
......@@ -113,6 +116,7 @@ class OwnerProtocolEngine extends AbstractProtocolEngine<OwnerSession> {
private OwnerSession onMailboxAccept(Transaction txn, OwnerSession s,
MailboxAcceptMessage m) throws DbException {
LOG.info("mailbox acccept");
// The dependency, if any, must be the last remote message
if (isInvalidDependency(s.getMailbox().lastRemoteMessageId,
m.getPreviousMessageId())) return abort(txn, s);
......@@ -139,6 +143,7 @@ class OwnerProtocolEngine extends AbstractProtocolEngine<OwnerSession> {
@Override
public OwnerSession onAuthMessage(Transaction txn, OwnerSession s,
MailboxAuthMessage m) throws DbException, FormatException {
LOG.info("Forward auth message");
// The dependency, if any, must be the last remote message
if (isInvalidDependency(s.getMailbox().getLastLocalMessageId(),
m.getPreviousMessageId())) return abort(txn, s);
......@@ -166,6 +171,7 @@ class OwnerProtocolEngine extends AbstractProtocolEngine<OwnerSession> {
@Override
public OwnerSession onIntroduceeAcceptMessage(Transaction txn,
OwnerSession s, IntroduceeAcceptMessage m) throws DbException {
LOG.info("Forward introducee accept message");
// The dependency, if any, must be the last remote message
if (isInvalidDependency(s.getIntroducee().getLastLocalMessageId(),
m.getPreviousMessageId())) return abort(txn, s);
......@@ -185,6 +191,7 @@ class OwnerProtocolEngine extends AbstractProtocolEngine<OwnerSession> {
private OwnerSession onLocalRequest(Transaction txn, OwnerSession s,
long timestamp) throws DbException {
LOG.info("local request intro");
// Send REQUEST messages
long maxIntroduceeTimestamp =
Math.max(getLocalTimestamp(s, s.getMailbox()),
......
......@@ -39,6 +39,7 @@ import static org.briarproject.briar.mailbox.MailboxState.CONTACT_ADDED;
class MailboxProtocolEngine extends AbstractProtocolEngine<MailboxSession> {
private final static Logger LOG =
Logger.getLogger(MailboxProtocolEngine.class.getName());
......@@ -46,14 +47,14 @@ class MailboxProtocolEngine extends AbstractProtocolEngine<MailboxSession> {
MailboxProtocolEngine(DatabaseComponent db, ClientHelper clientHelper,
ContactManager contactManager,
ContactGroupFactory contactGroupFactory,
IdentityManager identityManager,
IdentityManager identityManager,
MailboxMessageParser messageParser,
MailboxMessageEncoder messageEncoder, Clock clock,
MailboxIntroductionCrypto crypto,
KeyManager keyManager,
TransportPropertyManager transportPropertyManager) {
super(db, clientHelper, contactManager, contactGroupFactory,
identityManager, messageParser, messageEncoder,
identityManager, messageParser, messageEncoder,
clock, crypto, keyManager, transportPropertyManager);
}
......@@ -95,6 +96,7 @@ class MailboxProtocolEngine extends AbstractProtocolEngine<MailboxSession> {
private MailboxSession onRemoteRequest(Transaction txn, MailboxSession s,
RequestMessage m) throws DbException {
LOG.info("onRemoteREquest mailbox");
// The dependency, if any, must be the last remote message
if (isInvalidDependency(s, m.getPreviousMessageId()))
return abort(txn, s);
......@@ -243,6 +245,7 @@ class MailboxProtocolEngine extends AbstractProtocolEngine<MailboxSession> {
sendMailboxAuthMessage(txn, s, clock.currentTimeMillis(),
transportProperties, mac, signature,
s.getMessageCounter());
LOG.info("Contact from owner added");
//TODO: Check for reasons to decline and if any, move to LOCAL_DECLINE
return MailboxSession
.clear(s, CONTACT_ADDED, reply.getId(),
......
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