diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-05-17 01:47:48 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2018-05-17 01:47:50 +0200 |
commit | ba51ca6342454ab33b645d377405e36a9876ac5b (patch) | |
tree | f65c6beef005d83643c9bbabf4eb037a47b47186 | |
parent | 02a61fd36ffbc45500f8c18582114f38ef2547b2 (diff) |
Use correct key when adding message from invite key
-rw-r--r-- | src/main.cpp | 3 |
1 files changed, 1 insertions, 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<odhtdb::OwnedByteArray> channelEncryptionKey = make_shared<odhtdb::OwnedByteArray>(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); |