summaryrefslogtreecommitdiff
path: root/node/RuntimeEnvironment.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2017-07-06 10:25:36 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2017-07-06 10:25:36 -0700
commit2f20258807f8665bc3f9c527106e61761e01ecc3 (patch)
tree1be0f5f17cdb4df4486fa53a9f7153c5cfa7da23 /node/RuntimeEnvironment.hpp
parentbaa10c2995b7e0e49b49fe63a264a20982b817cf (diff)
downloadinfinitytier-2f20258807f8665bc3f9c527106e61761e01ecc3.tar.gz
infinitytier-2f20258807f8665bc3f9c527106e61761e01ecc3.zip
.
Diffstat (limited to 'node/RuntimeEnvironment.hpp')
-rw-r--r--node/RuntimeEnvironment.hpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/node/RuntimeEnvironment.hpp b/node/RuntimeEnvironment.hpp
index d8e1d699..ee0c8c24 100644
--- a/node/RuntimeEnvironment.hpp
+++ b/node/RuntimeEnvironment.hpp
@@ -30,8 +30,8 @@
#include <string>
#include "Constants.hpp"
+#include "Utils.hpp"
#include "Identity.hpp"
-#include "Mutex.hpp"
namespace ZeroTier {
@@ -58,10 +58,13 @@ public:
,mc((Multicaster *)0)
,topology((Topology *)0)
,sa((SelfAwareness *)0)
-#ifdef ZT_ENABLE_CLUSTER
- ,cluster((Cluster *)0)
-#endif
{
+ Utils::getSecureRandom(&instanceId,sizeof(instanceId));
+ }
+
+ ~RuntimeEnvironment()
+ {
+ Utils::burn(reinterpret_cast<void *>(const_cast<char *>(secretIdentityStr.data())),(unsigned int)secretIdentityStr.length());
}
// Node instance that owns this RuntimeEnvironment
@@ -87,9 +90,11 @@ public:
Multicaster *mc;
Topology *topology;
SelfAwareness *sa;
-#ifdef ZT_ENABLE_CLUSTER
- Cluster *cluster;
-#endif
+
+ /**
+ * A random integer identifying this run of ZeroTier
+ */
+ uint32_t instanceId;
};
} // namespace ZeroTier