aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-04-25 05:29:43 +0200
committerdec05eba <dec05eba@protonmail.com>2020-08-18 23:25:46 +0200
commit96469ee44afb7a31157d1653c172fc11f47d675c (patch)
tree0c77ff084882ffa689d67e5eaa175997d7b0d1e7 /include
parentc985ca6ccdf2ad6f21e3fbbada76030ddccb0fa0 (diff)
Store opendht identity in storage file (cached)
Diffstat (limited to 'include')
-rw-r--r--include/odhtdb/Database.hpp3
-rw-r--r--include/odhtdb/DatabaseStorage.hpp4
-rw-r--r--include/odhtdb/env.hpp4
3 files changed, 4 insertions, 7 deletions
diff --git a/include/odhtdb/Database.hpp b/include/odhtdb/Database.hpp
index a8833fc..846ddaa 100644
--- a/include/odhtdb/Database.hpp
+++ b/include/odhtdb/Database.hpp
@@ -12,9 +12,6 @@
#include "DatabaseNode.hpp"
#include "Encryption.hpp"
#include "OwnedMemory.hpp"
-#ifdef DEBUG
-#undef DEBUG
-#endif
#include <opendht/dhtrunner.h>
#include <vector>
#include <ntp/NtpClient.hpp>
diff --git a/include/odhtdb/DatabaseStorage.hpp b/include/odhtdb/DatabaseStorage.hpp
index a2789f7..a9e04ef 100644
--- a/include/odhtdb/DatabaseStorage.hpp
+++ b/include/odhtdb/DatabaseStorage.hpp
@@ -10,6 +10,7 @@
#include <stdexcept>
#include <boost/filesystem/path.hpp>
#include <sibs/SafeDeserializer.hpp>
+#include <opendht/crypto.h>
namespace odhtdb
{
@@ -106,6 +107,8 @@ namespace odhtdb
// Return users in node, or nullptr if no node with id @nodeHash exists
const Signature::MapPublicKey<UserData*>* getUsersData(const Hash &nodeHash) const;
+ const dht::crypto::Identity& getIdentity() const;
+
// Update storage state (remove quarantine objects if they are too old, etc)
void update();
private:
@@ -126,5 +129,6 @@ namespace odhtdb
boost::filesystem::path dataFilePath;
boost::filesystem::path metadataFilePath;
u8 passwordSalt[PASSWORD_SALT_LEN];
+ std::pair<std::shared_ptr<dht::crypto::PrivateKey>, std::shared_ptr<dht::crypto::Certificate>> identity;
};
}
diff --git a/include/odhtdb/env.hpp b/include/odhtdb/env.hpp
index bafc750..abaedd8 100644
--- a/include/odhtdb/env.hpp
+++ b/include/odhtdb/env.hpp
@@ -57,7 +57,3 @@
#if !defined(OS_TYPE)
#error "System not supported. Only Windows and linux systems supported right now"
#endif
-
-#if !defined(DEBUG) && !defined(NDEBUG)
-#define DEBUG
-#endif