mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 22:29:53 +01:00
Bug with checking contactId, improve logging
This commit is contained in:
@@ -152,7 +152,7 @@ class IncomingDuplexSyncConnection extends DuplexSyncConnection
|
|||||||
handshakeManager.handshake(contactId, in, out);
|
handshakeManager.handshake(contactId, in, out);
|
||||||
keyManager.addRotationKeys(contactId, result.getMasterKey(),
|
keyManager.addRotationKeys(contactId, result.getMasterKey(),
|
||||||
TIMESTAMP, result.isAlice(), true);
|
TIMESTAMP, result.isAlice(), true);
|
||||||
LOG.info("Rotation keys added");
|
LOG.info("Rotation keys added - IncomingDuplexSyncConnection");
|
||||||
return true;
|
return true;
|
||||||
} catch (IOException | DbException e) {
|
} catch (IOException | DbException e) {
|
||||||
logException(LOG, WARNING, e);
|
logException(LOG, WARNING, e);
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ class OutgoingDuplexSyncConnection extends DuplexSyncConnection
|
|||||||
LOG.info("Running OutgoingDuplexSyncConnection on transport " +
|
LOG.info("Running OutgoingDuplexSyncConnection on transport " +
|
||||||
transportId.getString());
|
transportId.getString());
|
||||||
// Allocate a stream context
|
// Allocate a stream context
|
||||||
|
|
||||||
StreamContext ctx = allocateStreamContext(contactId, transportId);
|
StreamContext ctx = allocateStreamContext(contactId, transportId);
|
||||||
if (ctx == null) {
|
if (ctx == null) {
|
||||||
LOG.warning("Could not allocate stream context");
|
LOG.warning("Could not allocate stream context");
|
||||||
@@ -71,6 +72,7 @@ class OutgoingDuplexSyncConnection extends DuplexSyncConnection
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (ctx.isHandshakeMode()) {
|
if (ctx.isHandshakeMode()) {
|
||||||
|
LOG.info("OutgoingDuplexSyncConnection - context is in handshake mode, performing handshake");
|
||||||
if (!performHandshake(ctx)) {
|
if (!performHandshake(ctx)) {
|
||||||
LOG.warning("Handshake failed");
|
LOG.warning("Handshake failed");
|
||||||
return;
|
return;
|
||||||
@@ -178,7 +180,7 @@ class OutgoingDuplexSyncConnection extends DuplexSyncConnection
|
|||||||
}
|
}
|
||||||
// Check that the stream comes from the expected contact
|
// Check that the stream comes from the expected contact
|
||||||
ContactId inContactId = ctxIn.getContactId();
|
ContactId inContactId = ctxIn.getContactId();
|
||||||
if (contactId == null) {
|
if (inContactId == null) {
|
||||||
LOG.warning("Expected contact tag, got rendezvous tag");
|
LOG.warning("Expected contact tag, got rendezvous tag");
|
||||||
onReadError();
|
onReadError();
|
||||||
return false;
|
return false;
|
||||||
@@ -197,7 +199,7 @@ class OutgoingDuplexSyncConnection extends DuplexSyncConnection
|
|||||||
handshakeManager.handshake(contactId, in, out);
|
handshakeManager.handshake(contactId, in, out);
|
||||||
keyManager.addRotationKeys(contactId, result.getMasterKey(),
|
keyManager.addRotationKeys(contactId, result.getMasterKey(),
|
||||||
TIMESTAMP, result.isAlice(), true);
|
TIMESTAMP, result.isAlice(), true);
|
||||||
LOG.info("Rotation keys added");
|
LOG.info("Rotation keys added - OutgoingDuplexSyncConnection");
|
||||||
return true;
|
return true;
|
||||||
} catch (IOException | DbException e) {
|
} catch (IOException | DbException e) {
|
||||||
logException(LOG, WARNING, e);
|
logException(LOG, WARNING, e);
|
||||||
|
|||||||
Reference in New Issue
Block a user