diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-09-16 13:57:57 -0400 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-09-16 13:57:57 -0400 |
| commit | e376c6f6a989d99d873918b349405302b62403a5 (patch) | |
| tree | 446962e3a4d17a6d6aaa2976c2da156f5a5e2a03 /main.cpp | |
| parent | ceb024ab03a114c8dadbbd393032231069981c45 (diff) | |
| download | infinitytier-e376c6f6a989d99d873918b349405302b62403a5.tar.gz infinitytier-e376c6f6a989d99d873918b349405302b62403a5.zip | |
New crypto integrated -- going to be testing new identity address generation algo a bit more before finalizing.
Diffstat (limited to 'main.cpp')
| -rw-r--r-- | main.cpp | 34 |
1 files changed, 0 insertions, 34 deletions
@@ -49,8 +49,6 @@ #include <signal.h> #endif -#include <openssl/rand.h> - #include "node/Constants.hpp" #include "node/Defaults.hpp" #include "node/Utils.hpp" @@ -58,36 +56,6 @@ using namespace ZeroTier; -// --------------------------------------------------------------------------- -// Override libcrypto default RAND_ with Utils::getSecureRandom(), which uses -// a system strong random source. This is because OpenSSL libcrypto's default -// RAND_ implementation uses uninitialized memory as one of its entropy -// sources, which plays havoc with all kinds of debuggers and auditing tools. - -static void _zeroTier_rand_cleanup() {} -static void _zeroTier_rand_add(const void *buf, int num, double add_entropy) {} -static int _zeroTier_rand_status() { return 1; } -static void _zeroTier_rand_seed(const void *buf, int num) {} -static int _zeroTier_rand_bytes(unsigned char *buf, int num) -{ - Utils::getSecureRandom(buf,num); - return 1; -} -static RAND_METHOD _zeroTierRandMethod = { - _zeroTier_rand_seed, - _zeroTier_rand_bytes, - _zeroTier_rand_cleanup, - _zeroTier_rand_add, - _zeroTier_rand_bytes, - _zeroTier_rand_status -}; -static void _initLibCrypto() -{ - RAND_set_rand_method(&_zeroTierRandMethod); -} - -// --------------------------------------------------------------------------- - static Node *node = (Node *)0; static void printHelp(const char *cn,FILE *out) @@ -145,8 +113,6 @@ int main(int argc,char **argv) SetConsoleCtrlHandler(&_handlerRoutine,TRUE); #endif - _initLibCrypto(); - const char *homeDir = (const char *)0; for(int i=1;i<argc;++i) { if (argv[i][0] == '-') { |
