mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 13:49:53 +01:00
When setting remote handshake key, derive tags
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package org.briarproject.bramble.contact;
|
package org.briarproject.bramble.contact;
|
||||||
|
|
||||||
|
import com.sun.tools.javac.jvm.Gen;
|
||||||
|
|
||||||
import org.briarproject.bramble.api.FormatException;
|
import org.briarproject.bramble.api.FormatException;
|
||||||
import org.briarproject.bramble.api.Pair;
|
import org.briarproject.bramble.api.Pair;
|
||||||
import org.briarproject.bramble.api.contact.Contact;
|
import org.briarproject.bramble.api.contact.Contact;
|
||||||
@@ -249,17 +251,19 @@ class ContactManagerImpl implements ContactManager, EventListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setHandshakePublicKey(Transaction txn, ContactId c,
|
public void setHandshakePublicKey(Transaction txn, ContactId c,
|
||||||
PublicKey handshakePublicKey) throws DbException {
|
PublicKey handshakePublicKey) throws DbException, GeneralSecurityException {
|
||||||
if (handshakePublicKey.getKeyType() !=
|
if (handshakePublicKey.getKeyType() !=
|
||||||
CryptoConstants.KEY_TYPE_AGREEMENT) {
|
CryptoConstants.KEY_TYPE_AGREEMENT) {
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
}
|
}
|
||||||
db.setHandshakePublicKey(txn, c, handshakePublicKey);
|
db.setHandshakePublicKey(txn, c, handshakePublicKey);
|
||||||
|
KeyPair ourKeyPair = identityManager.getHandshakeKeys(txn);
|
||||||
|
keyManager.addContact(txn, c, handshakePublicKey, ourKeyPair);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setHandshakePublicKey(ContactId c, PublicKey handshakePublicKey)
|
public void setHandshakePublicKey(ContactId c, PublicKey handshakePublicKey)
|
||||||
throws DbException {
|
throws DbException, GeneralSecurityException {
|
||||||
db.transaction(false,
|
db.transaction(false,
|
||||||
txn -> setHandshakePublicKey(txn, c, handshakePublicKey));
|
txn -> setHandshakePublicKey(txn, c, handshakePublicKey));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user