aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <0xdec05eba@gmail.com>2018-04-25 05:29:43 +0200
committerdec05eba <0xdec05eba@gmail.com>2018-04-25 05:29:49 +0200
commitd71fe129b83f34b46136070fcf9a64865203be14 (patch)
treebd5d6bb47274f4a1e6e89a29f06498689e470505 /include
parent13718f15767db6774dbf562b6798838ad9058984 (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