This commit is contained in:
Adam Ierymenko 2017-07-06 16:11:11 -07:00
parent 53728b79b4
commit d2415dee00
32 changed files with 620 additions and 678 deletions

View file

@ -27,7 +27,7 @@
#ifndef ZT_RUNTIMEENVIRONMENT_HPP
#define ZT_RUNTIMEENVIRONMENT_HPP
#include <string>
#include <string.h>
#include "Constants.hpp"
#include "Utils.hpp"
@ -60,11 +60,13 @@ public:
,sa((SelfAwareness *)0)
{
Utils::getSecureRandom(&instanceId,sizeof(instanceId));
memset(publicIdentityStr,0,sizeof(publicIdentityStr));
memset(secretIdentityStr,0,sizeof(secretIdentityStr));
}
~RuntimeEnvironment()
{
Utils::burn(reinterpret_cast<void *>(const_cast<char *>(secretIdentityStr.data())),(unsigned int)secretIdentityStr.length());
Utils::burn(secretIdentityStr,sizeof(secretIdentityStr));
}
/**
@ -77,8 +79,8 @@ public:
// This node's identity
Identity identity;
std::string publicIdentityStr;
std::string secretIdentityStr;
char publicIdentityStr[ZT_IDENTITY_STRING_BUFFER_LENGTH];
char secretIdentityStr[ZT_IDENTITY_STRING_BUFFER_LENGTH];
// This is set externally to an instance of this base class
NetworkController *localNetworkController;