mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 19:59:05 +01:00
Removed tag from connection context.
This commit is contained in:
@@ -141,9 +141,8 @@ public class ProtocolIntegrationTest extends BriarTestCase {
|
||||
|
||||
private byte[] write() throws Exception {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
byte[] tag = new byte[TAG_LENGTH];
|
||||
ConnectionContext ctx = new ConnectionContext(contactId, transportId,
|
||||
tag, secret.clone(), 0L, true);
|
||||
secret.clone(), 0L, true);
|
||||
ConnectionWriter conn = connectionWriterFactory.createConnectionWriter(
|
||||
out, Long.MAX_VALUE, ctx, true);
|
||||
OutputStream out1 = conn.getOutputStream();
|
||||
@@ -192,7 +191,7 @@ public class ProtocolIntegrationTest extends BriarTestCase {
|
||||
assertEquals(TAG_LENGTH, in.read(tag, 0, TAG_LENGTH));
|
||||
assertArrayEquals(new byte[TAG_LENGTH], tag);
|
||||
ConnectionContext ctx = new ConnectionContext(contactId, transportId,
|
||||
tag, secret.clone(), 0L, true);
|
||||
secret.clone(), 0L, true);
|
||||
ConnectionReader conn = connectionReaderFactory.createConnectionReader(
|
||||
in, ctx, true);
|
||||
InputStream in1 = conn.getInputStream();
|
||||
|
||||
@@ -91,9 +91,8 @@ public class OutgoingSimplexConnectionTest extends BriarTestCase {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
TestSimplexTransportWriter transport = new TestSimplexTransportWriter(
|
||||
out, MAX_PACKET_LENGTH, true);
|
||||
byte[] tag = new byte[TAG_LENGTH];
|
||||
ConnectionContext ctx = new ConnectionContext(contactId, transportId,
|
||||
tag, secret, 0L, true);
|
||||
secret, 0L, true);
|
||||
OutgoingSimplexConnection connection = new OutgoingSimplexConnection(db,
|
||||
connRegistry, connFactory, protoFactory, ctx, transport);
|
||||
connection.write();
|
||||
@@ -109,9 +108,8 @@ public class OutgoingSimplexConnectionTest extends BriarTestCase {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
TestSimplexTransportWriter transport = new TestSimplexTransportWriter(
|
||||
out, MIN_CONNECTION_LENGTH, true);
|
||||
byte[] tag = new byte[TAG_LENGTH];
|
||||
ConnectionContext ctx = new ConnectionContext(contactId, transportId,
|
||||
tag, secret, 0L, true);
|
||||
secret, 0L, true);
|
||||
OutgoingSimplexConnection connection = new OutgoingSimplexConnection(db,
|
||||
connRegistry, connFactory, protoFactory, ctx, transport);
|
||||
context.checking(new Expectations() {{
|
||||
@@ -142,9 +140,8 @@ public class OutgoingSimplexConnectionTest extends BriarTestCase {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
TestSimplexTransportWriter transport = new TestSimplexTransportWriter(
|
||||
out, MIN_CONNECTION_LENGTH, true);
|
||||
byte[] tag = new byte[TAG_LENGTH];
|
||||
ConnectionContext ctx = new ConnectionContext(contactId, transportId,
|
||||
tag, secret, 0L, true);
|
||||
secret, 0L, true);
|
||||
OutgoingSimplexConnection connection = new OutgoingSimplexConnection(db,
|
||||
connRegistry, connFactory, protoFactory, ctx, transport);
|
||||
final Ack ack = context.mock(Ack.class);
|
||||
|
||||
@@ -115,10 +115,8 @@ public class SimplexProtocolIntegrationTest extends BriarTestCase {
|
||||
alice.getInstance(ProtocolWriterFactory.class);
|
||||
TestSimplexTransportWriter transport = new TestSimplexTransportWriter(
|
||||
out, Long.MAX_VALUE, false);
|
||||
// FIXME: Encode the tag
|
||||
byte[] tag = new byte[TAG_LENGTH];
|
||||
ConnectionContext ctx = new ConnectionContext(contactId, transportId,
|
||||
tag, aliceToBobSecret, 0L, true);
|
||||
aliceToBobSecret, 0L, true);
|
||||
OutgoingSimplexConnection simplex = new OutgoingSimplexConnection(db,
|
||||
connRegistry, connFactory, protoFactory, ctx, transport);
|
||||
// Write whatever needs to be written
|
||||
|
||||
@@ -2,7 +2,6 @@ package net.sf.briar.transport;
|
||||
|
||||
import static net.sf.briar.api.protocol.ProtocolConstants.MAX_PACKET_LENGTH;
|
||||
import static net.sf.briar.api.transport.TransportConstants.MIN_CONNECTION_LENGTH;
|
||||
import static net.sf.briar.api.transport.TransportConstants.TAG_LENGTH;
|
||||
import static org.junit.Assert.assertArrayEquals;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
@@ -128,9 +127,8 @@ public class TransportIntegrationTest extends BriarTestCase {
|
||||
public void testOverheadWithTag() throws Exception {
|
||||
ByteArrayOutputStream out =
|
||||
new ByteArrayOutputStream(MIN_CONNECTION_LENGTH);
|
||||
byte[] tag = new byte[TAG_LENGTH];
|
||||
ConnectionContext ctx = new ConnectionContext(contactId, transportId,
|
||||
tag, secret, 0L, true);
|
||||
secret, 0L, true);
|
||||
ConnectionWriter w = connectionWriterFactory.createConnectionWriter(out,
|
||||
MIN_CONNECTION_LENGTH, ctx, true);
|
||||
// Check that the connection writer thinks there's room for a packet
|
||||
@@ -151,7 +149,7 @@ public class TransportIntegrationTest extends BriarTestCase {
|
||||
ByteArrayOutputStream out =
|
||||
new ByteArrayOutputStream(MIN_CONNECTION_LENGTH);
|
||||
ConnectionContext ctx = new ConnectionContext(contactId, transportId,
|
||||
null, secret, 0L, true);
|
||||
secret, 0L, true);
|
||||
ConnectionWriter w = connectionWriterFactory.createConnectionWriter(out,
|
||||
MIN_CONNECTION_LENGTH, ctx, false);
|
||||
// Check that the connection writer thinks there's room for a packet
|
||||
|
||||
Reference in New Issue
Block a user