diff options
Diffstat (limited to 'src/Database.cpp')
-rw-r--r-- | src/Database.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Database.cpp b/src/Database.cpp index fff74f4..df11b3c 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -90,10 +90,10 @@ namespace odhtdb } Database::Database(const char *bootstrapNodeAddr, u16 port, const boost::filesystem::path &storageDir, DatabaseCallbackFuncs callbackFuncs) : + databaseStorage(this, storageDir), onCreateNodeCallbackFunc(callbackFuncs.createNodeCallbackFunc), onAddNodeCallbackFunc(callbackFuncs.addNodeCallbackFunc), onAddUserCallbackFunc(callbackFuncs.addUserCallbackFunc), - databaseStorage(this, storageDir), shuttingDown(false) { node.run(port , { @@ -443,7 +443,7 @@ namespace odhtdb serializer.add(newActionCounter); DataView encryptionKey(nodeInfo.getNodeEncryptionKey()->data, ENCRYPTION_KEY_BYTE_SIZE); - Encryption encryptedBody(dataToAdd, DataView(), encryptionKey); + Encryption encryptedBody(dataToAdd, encryptionKey); OwnedMemory requestData = combine(serializer, encryptedBody); string signedRequestData = userToPerformActionWith.getPrivateKey().sign(requestData.getView()); OwnedMemory stagedAddObject = combine(userToPerformActionWith.getPublicKey(), signedRequestData); @@ -643,14 +643,14 @@ namespace odhtdb return databaseStorage.storeUserWithoutNodes(username, password); } - void Database::storeUserPasswordEncrypted(const Hash &nodeHash, const string &username, const string &password, const Signature::KeyPair &keyPair) + void Database::storeNodeInfoForUserEncrypted(const DatabaseNode &nodeInfo, const string &username, const string &password, const Signature::KeyPair &keyPair) { - return databaseStorage.storeUserPasswordEncrypted(nodeHash, username, password, keyPair); + return databaseStorage.storeNodeInfoForUserEncrypted(nodeInfo, username, password, keyPair); } - MapHash<Signature::KeyPair> Database::getStoredUserNodeDataDecrypted(const string &username, const string &password) + MapHash<StoredNodeInfo> Database::getStoredNodeUserInfoDecrypted(const string &username, const string &password) const { - return databaseStorage.getStoredUserNodeDataDecrypted(username, password); + return databaseStorage.getStoredNodeUserInfoDecrypted(username, password); } vector<OwnedMemory> Database::getUserGroups(const Hash &nodeHash, const Signature::PublicKey &userPublicKey) const |