Skip to content
Snippets Groups Projects
Verified Commit 68132d89 authored by akwizgran's avatar akwizgran
Browse files

IntroduceeProtocolEngine uses wrong role when adding keys.

parent d7492df8
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,8 @@ public interface ContactManager { ...@@ -24,6 +24,8 @@ public interface ContactManager {
* Stores a contact associated with the given local and remote pseudonyms, * Stores a contact associated with the given local and remote pseudonyms,
* derives and stores transport keys for each transport, and returns an ID * derives and stores transport keys for each transport, and returns an ID
* for the contact. * for the contact.
*
* @param alice true if the local party is Alice
*/ */
ContactId addContact(Transaction txn, Author remote, AuthorId local, ContactId addContact(Transaction txn, Author remote, AuthorId local,
SecretKey master, long timestamp, boolean alice, boolean verified, SecretKey master, long timestamp, boolean alice, boolean verified,
...@@ -38,7 +40,10 @@ public interface ContactManager { ...@@ -38,7 +40,10 @@ public interface ContactManager {
/** /**
* Stores a contact associated with the given local and remote pseudonyms, * 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, ContactId addContact(Author remote, AuthorId local,
SecretKey master, long timestamp, boolean alice, boolean verified, SecretKey master, long timestamp, boolean alice, boolean verified,
......
...@@ -23,6 +23,8 @@ public interface KeyManager { ...@@ -23,6 +23,8 @@ public interface KeyManager {
* <p/> * <p/>
* {@link StreamContext StreamContexts} for the contact can be created * {@link StreamContext StreamContexts} for the contact can be created
* after this method has returned. * after this method has returned.
*
* @param alice true if the local party is Alice
*/ */
void addContact(Transaction txn, ContactId c, SecretKey master, void addContact(Transaction txn, ContactId c, SecretKey master,
long timestamp, boolean alice) throws DbException; long timestamp, boolean alice) throws DbException;
...@@ -33,6 +35,8 @@ public interface KeyManager { ...@@ -33,6 +35,8 @@ public interface KeyManager {
* <p/> * <p/>
* The keys must be bound before they can be used for incoming streams, * The keys must be bound before they can be used for incoming streams,
* and also activated before they can be used for outgoing 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, Map<TransportId, KeySetId> addUnboundKeys(Transaction txn, SecretKey master,
long timestamp, boolean alice) throws DbException; long timestamp, boolean alice) throws DbException;
...@@ -55,7 +59,7 @@ public interface KeyManager { ...@@ -55,7 +59,7 @@ public interface KeyManager {
* the manager and the database. * the manager and the database.
*/ */
void removeKeys(Transaction txn, Map<TransportId, KeySetId> keys) 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 * Returns true if we have keys that can be used for outgoing streams to
......
...@@ -457,7 +457,7 @@ class IntroduceeProtocolEngine ...@@ -457,7 +457,7 @@ class IntroduceeProtocolEngine
//noinspection ConstantConditions //noinspection ConstantConditions
keys = keyManager keys = keyManager
.addUnboundKeys(txn, new SecretKey(s.getMasterKey()), .addUnboundKeys(txn, new SecretKey(s.getMasterKey()),
timestamp, s.getRemote().alice); timestamp, s.getLocal().alice);
keyManager.bindKeys(txn, c.getId(), keys); keyManager.bindKeys(txn, c.getId(), keys);
// add signed transport properties for the contact // add signed transport properties for the contact
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment