aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-16 08:13:26 +0200
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:25:46 +0200
commite81a274f8b330005401c52bc281f5efeee05e116 (patch)
tree18a197312f7980eaccebd31366b064edabcbfd8b /include
parent92d6393a34dac4b3d623a5169e2b50a9518b4976 (diff)
Return stored node users decrypted as hash map instead of vector
Diffstat (limited to 'include')
-rw-r--r--include/odhtdb/Database.hpp2
-rw-r--r--include/odhtdb/DatabaseStorage.hpp8
2 files changed, 2 insertions, 8 deletions
diff --git a/include/odhtdb/Database.hpp b/include/odhtdb/Database.hpp
index bd7b3f5..87389eb 100644
--- a/include/odhtdb/Database.hpp
+++ b/include/odhtdb/Database.hpp
@@ -192,7 +192,7 @@ namespace odhtdb
// Returns nodes, public key and private key of encrypted user.
// Throws DatabaseStorageWrongPassword if password for the stored user is wrong.
- std::vector<NodeUserKeyPair> getStoredUserNodeDataDecrypted(const std::string &username, const std::string &password);
+ MapHash<Signature::KeyPair> getStoredUserNodeDataDecrypted(const std::string &username, const std::string &password);
std::vector<OwnedMemory> getUserGroups(const Hash &nodeHash, const Signature::PublicKey &userPublicKey) const;
diff --git a/include/odhtdb/DatabaseStorage.hpp b/include/odhtdb/DatabaseStorage.hpp
index 2b1e552..264ab57 100644
--- a/include/odhtdb/DatabaseStorage.hpp
+++ b/include/odhtdb/DatabaseStorage.hpp
@@ -72,12 +72,6 @@ namespace odhtdb
using FetchNodeUserActionGapsCallbackFunc = std::function<void(const DataView userPublicKey, u64 start, u64 range)>;
using FetchNodeUserLatestActionCounterCallbackFunc = std::function<void(const DataView userPublicKey, u64 latestActionCounter)>;
- struct NodeUserKeyPair
- {
- const Hash nodeHash;
- const Signature::KeyPair keyPair;
- };
-
class DatabaseStorage
{
public:
@@ -130,7 +124,7 @@ namespace odhtdb
// Returns nodes, public key and private key of encrypted user.
// Throws DatabaseStorageWrongPassword if password for the stored user is wrong.
// Throws DatabaseStorageNoSuchStoredUser if user doesn't exist.
- std::vector<NodeUserKeyPair> getStoredUserNodeDataDecrypted(const std::string &username, const std::string &password);
+ MapHash<Signature::KeyPair> getStoredUserNodeDataDecrypted(const std::string &username, const std::string &password);
// Returns true and node decryption key if node exists and we have the decryption key,
// otherwise return false and OwnedMemory with data set to nullptr