Merge branch '474-alice-flag' into 'master'

IntroduceeProtocolEngine uses wrong role when adding keys

See merge request akwizgran/briar!780
This commit is contained in:
Torsten Grote
2018-04-29 02:27:18 +00:00
3 changed files with 12 additions and 3 deletions

View File

@@ -24,6 +24,8 @@ public interface ContactManager {
* Stores a contact associated with the given local and remote pseudonyms,
* derives and stores transport keys for each transport, and returns an ID
* for the contact.
*
* @param alice true if the local party is Alice
*/
ContactId addContact(Transaction txn, Author remote, AuthorId local,
SecretKey master, long timestamp, boolean alice, boolean verified,
@@ -38,7 +40,10 @@ public interface ContactManager {
/**
* Stores a contact associated with the given local and remote pseudonyms,
* and returns an ID for the contact.
* derives and stores transport keys for each transport, and returns an ID
* for the contact.
*
* @param alice true if the local party is Alice
*/
ContactId addContact(Author remote, AuthorId local,
SecretKey master, long timestamp, boolean alice, boolean verified,

View File

@@ -23,6 +23,8 @@ public interface KeyManager {
* <p/>
* {@link StreamContext StreamContexts} for the contact can be created
* after this method has returned.
*
* @param alice true if the local party is Alice
*/
void addContact(Transaction txn, ContactId c, SecretKey master,
long timestamp, boolean alice) throws DbException;
@@ -33,6 +35,8 @@ public interface KeyManager {
* <p/>
* The keys must be bound before they can be used for incoming streams,
* and also activated before they can be used for outgoing streams.
*
* @param alice true if the local party is Alice
*/
Map<TransportId, KeySetId> addUnboundKeys(Transaction txn, SecretKey master,
long timestamp, boolean alice) throws DbException;
@@ -55,7 +59,7 @@ public interface KeyManager {
* the manager and the database.
*/
void removeKeys(Transaction txn, Map<TransportId, KeySetId> keys)
throws DbException;
throws DbException;
/**
* Returns true if we have keys that can be used for outgoing streams to

View File

@@ -457,7 +457,7 @@ class IntroduceeProtocolEngine
//noinspection ConstantConditions
keys = keyManager
.addUnboundKeys(txn, new SecretKey(s.getMasterKey()),
timestamp, s.getRemote().alice);
timestamp, s.getLocal().alice);
keyManager.bindKeys(txn, c.getId(), keys);
// add signed transport properties for the contact