mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Derive handshake root key when adding a pending contact.
This commit is contained in:
@@ -11,6 +11,12 @@ import java.security.GeneralSecurityException;
|
||||
*/
|
||||
public interface TransportCrypto {
|
||||
|
||||
/**
|
||||
* Returns true if the local peer is Alice.
|
||||
*/
|
||||
boolean isAlice(PublicKey theirHandshakePublicKey,
|
||||
KeyPair ourHandshakeKeyPair);
|
||||
|
||||
/**
|
||||
* Derives the static master key shared with a contact or pending contact.
|
||||
*/
|
||||
@@ -19,6 +25,7 @@ public interface TransportCrypto {
|
||||
|
||||
/**
|
||||
* Derives the handshake mode root key from the static master key.
|
||||
*
|
||||
* @param pendingContact Whether the static master key is shared with a
|
||||
* pending contact or a contact
|
||||
*/
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
package org.briarproject.bramble.api.transport;
|
||||
|
||||
import org.briarproject.bramble.api.contact.ContactId;
|
||||
import org.briarproject.bramble.api.contact.PendingContact;
|
||||
import org.briarproject.bramble.api.contact.PendingContactId;
|
||||
import org.briarproject.bramble.api.crypto.KeyPair;
|
||||
import org.briarproject.bramble.api.crypto.SecretKey;
|
||||
import org.briarproject.bramble.api.db.DbException;
|
||||
import org.briarproject.bramble.api.db.Transaction;
|
||||
import org.briarproject.bramble.api.plugin.TransportId;
|
||||
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@@ -53,12 +56,10 @@ public interface KeyManager {
|
||||
* <p/>
|
||||
* {@link StreamContext StreamContexts} for the pending contact can be
|
||||
* created after this method has returned.
|
||||
*
|
||||
* @param alice True if the local party is Alice
|
||||
*/
|
||||
Map<TransportId, KeySetId> addPendingContact(Transaction txn,
|
||||
PendingContactId p, SecretKey rootKey, boolean alice)
|
||||
throws DbException;
|
||||
PendingContact p, KeyPair ourKeyPair)
|
||||
throws DbException, GeneralSecurityException;
|
||||
|
||||
/**
|
||||
* Marks the given transport keys as usable for outgoing streams.
|
||||
|
||||
Reference in New Issue
Block a user