From ba51ca6342454ab33b645d377405e36a9876ac5b Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 17 May 2018 01:47:48 +0200 Subject: Use correct key when adding message from invite key --- src/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 776db5c..9d8c6aa 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -453,8 +453,6 @@ int main(int argc, char **argv) sibs::SafeSerializer serializer; serializer.add((const u8*)keyPair->getPublicKey().getData(), keyPair->getPublicKey().getSize()); - localNodeUsers[*nodeHash] = { encryptionKey, keyPair }; - const char *msg = "please let me join"; odhtdb::Encryption encryptedJoinMsg(odhtdb::DataView((void*)msg, strlen(msg)), encryptionKey->getView()); sibs::SafeSerializer encryptedDataSerializer; @@ -500,6 +498,7 @@ int main(int argc, char **argv) shared_ptr channelEncryptionKey = make_shared(new u8[channelEncryptionKeyRaw.size], channelEncryptionKeyRaw.size); memcpy(channelEncryptionKey->data, channelEncryptionKeyRaw.data, channelEncryptionKeyRaw.size); odhtdb::DatabaseNode databaseNode(channelEncryptionKey, nodeHash); + localNodeUsers[*nodeHash] = { channelEncryptionKey, keyPair }; database->storeNodeInfoForUserEncrypted(databaseNode, currentUsername, currentPassword, *keyPair); printf("Got a response from a person in the channel, we might get added...\n"); waitingToJoinChannels.push_back(databaseNode); -- cgit v1.2.3