mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
Key derivation function based on NIST SP 800-108.
This commit is contained in:
@@ -99,7 +99,7 @@ public class ProtocolIntegrationTest extends TestCase {
|
||||
assertEquals(crypto.getMessageDigest().getDigestLength(),
|
||||
UniqueId.LENGTH);
|
||||
Random r = new Random();
|
||||
aliceToBobSecret = new byte[123];
|
||||
aliceToBobSecret = new byte[32];
|
||||
r.nextBytes(aliceToBobSecret);
|
||||
// Create two groups: one restricted, one unrestricted
|
||||
GroupFactory groupFactory = i.getInstance(GroupFactory.class);
|
||||
|
||||
@@ -97,9 +97,9 @@ public abstract class DatabaseComponentTest extends TestCase {
|
||||
properties);
|
||||
transports = Collections.singletonList(transport);
|
||||
Random r = new Random();
|
||||
inSecret = new byte[123];
|
||||
inSecret = new byte[32];
|
||||
r.nextBytes(inSecret);
|
||||
outSecret = new byte[123];
|
||||
outSecret = new byte[32];
|
||||
r.nextBytes(outSecret);
|
||||
}
|
||||
|
||||
|
||||
@@ -123,9 +123,9 @@ public class H2DatabaseTest extends TestCase {
|
||||
remoteTransports = Collections.singletonList(remoteTransport);
|
||||
subscriptions = Collections.singletonMap(group, 0L);
|
||||
Random r = new Random();
|
||||
inSecret = new byte[123];
|
||||
inSecret = new byte[32];
|
||||
r.nextBytes(inSecret);
|
||||
outSecret = new byte[123];
|
||||
outSecret = new byte[32];
|
||||
r.nextBytes(outSecret);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ConnectionRecogniserImplTest extends TestCase {
|
||||
Injector i = Guice.createInjector(new CryptoModule());
|
||||
crypto = i.getInstance(CryptoComponent.class);
|
||||
contactId = new ContactId(1);
|
||||
inSecret = new byte[123];
|
||||
inSecret = new byte[32];
|
||||
new Random().nextBytes(inSecret);
|
||||
transportId = new TransportId(TestUtils.getRandomId());
|
||||
localIndex = new TransportIndex(13);
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ConnectionWriterTest extends TestCase {
|
||||
new TestDatabaseModule(), new TransportBatchModule(),
|
||||
new TransportModule(), new TransportStreamModule());
|
||||
connectionWriterFactory = i.getInstance(ConnectionWriterFactory.class);
|
||||
outSecret = new byte[123];
|
||||
outSecret = new byte[32];
|
||||
new Random().nextBytes(outSecret);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class FrameReadWriteTest extends TestCase {
|
||||
frameCipher = crypto.getFrameCipher();
|
||||
random = new Random();
|
||||
// Since we're sending frames to ourselves, we only need outgoing keys
|
||||
outSecret = new byte[123];
|
||||
outSecret = new byte[32];
|
||||
random.nextBytes(outSecret);
|
||||
ivKey = crypto.deriveIvKey(outSecret, true);
|
||||
frameKey = crypto.deriveFrameKey(outSecret, true);
|
||||
|
||||
@@ -65,9 +65,9 @@ public class BatchConnectionReadWriteTest extends TestCase {
|
||||
transportIndex = new TransportIndex(1);
|
||||
// Create matching secrets for Alice and Bob
|
||||
Random r = new Random();
|
||||
aliceToBobSecret = new byte[123];
|
||||
aliceToBobSecret = new byte[32];
|
||||
r.nextBytes(aliceToBobSecret);
|
||||
bobToAliceSecret = new byte[123];
|
||||
bobToAliceSecret = new byte[32];
|
||||
r.nextBytes(bobToAliceSecret);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user