mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2026-09-22 15:29:03 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6248c7cb7 | ||
|
|
f6e7be102a | ||
|
|
c8213a3f58 | ||
|
|
d19516b40a | ||
|
|
ca5334509c | ||
|
|
a0a9d52213 | ||
|
|
2efc9b31bd | ||
|
|
1d9977b8b9 | ||
|
|
edad580c32 | ||
|
|
2536352e5d | ||
|
|
dbb509a302 | ||
|
|
3daf73710a | ||
|
|
d372cd1b17 | ||
|
|
ee7e826f0c | ||
|
|
d7bd3e37cb | ||
|
|
b23748aa5a | ||
|
|
8584515a50 | ||
|
|
08fe84d707 | ||
|
|
150a53eb17 | ||
|
|
1f9a7e26ba | ||
|
|
fc18334dbb | ||
|
|
4ce88d7f72 | ||
|
|
ce1a03bde3 | ||
|
|
d6414c9ff7 | ||
|
|
5076c75b07 | ||
|
|
36af3d92ec | ||
|
|
2ad80063ec | ||
|
|
2fbe1e200b | ||
|
|
53996050a2 | ||
|
|
f5d77a1bc2 | ||
|
|
93a7eef2a5 | ||
|
|
67acba4bc9 | ||
|
|
9979474f1e | ||
|
|
6c53891b44 | ||
|
|
95a23dc7ec | ||
|
|
7c3a446499 | ||
|
|
6a24ac4f00 | ||
|
|
3af55f4423 | ||
|
|
95c0790a88 | ||
|
|
5cabb60a6f | ||
|
|
86056fdbd9 | ||
|
|
8a46452a70 |
No files matched your search
+10
@@ -6,3 +6,13 @@ zerotier-*
|
||||
*.dSYM
|
||||
mac-tap/tuntap/src/tap/tap
|
||||
mac-tap/tuntap/tap.kext
|
||||
/ipch
|
||||
/ZeroTierOne.sdf
|
||||
/ZeroTierOne.v11.suo
|
||||
/vsprojects/SelfTest/Debug
|
||||
/vsprojects/SelfTest/Release
|
||||
/Debug
|
||||
/Release
|
||||
*.log
|
||||
*.opensdf
|
||||
*.user
|
||||
+4
-4
@@ -6,12 +6,12 @@ ARCH=$(shell uname -m)
|
||||
DEFS=-DZT_ARCH="$(ARCH)" -DZT_OSNAME="linux" -DZT_TRACE
|
||||
|
||||
# Uncomment for a release optimized build
|
||||
CFLAGS=-Wall -O3 -fno-unroll-loops -fstack-protector -pthread $(INCLUDES) -DNDEBUG $(DEFS)
|
||||
STRIP=strip --strip-all
|
||||
#CFLAGS=-Wall -O3 -fno-unroll-loops -fstack-protector -pthread $(INCLUDES) -DNDEBUG $(DEFS)
|
||||
#STRIP=strip --strip-all
|
||||
|
||||
# Uncomment for a debug build
|
||||
#CFLAGS=-Wall -g -pthread $(INCLUDES) -DZT_TRACE -DZT_LOG_STDOUT $(DEFS)
|
||||
#STRIP=echo
|
||||
CFLAGS=-Wall -g -pthread $(INCLUDES) -DZT_TRACE $(DEFS)
|
||||
STRIP=echo
|
||||
|
||||
CXXFLAGS=$(CFLAGS) -fno-rtti
|
||||
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SelfTest", "vsprojects\SelfTest\SelfTest.vcxproj", "{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
Vista Debug|Win32 = Vista Debug|Win32
|
||||
Vista Debug|x64 = Vista Debug|x64
|
||||
Vista Release|Win32 = Vista Release|Win32
|
||||
Vista Release|x64 = Vista Release|x64
|
||||
Win7 Debug|Win32 = Win7 Debug|Win32
|
||||
Win7 Debug|x64 = Win7 Debug|x64
|
||||
Win7 Release|Win32 = Win7 Release|Win32
|
||||
Win7 Release|x64 = Win7 Release|x64
|
||||
Win8 Debug|Win32 = Win8 Debug|Win32
|
||||
Win8 Debug|x64 = Win8 Debug|x64
|
||||
Win8 Release|Win32 = Win8 Release|Win32
|
||||
Win8 Release|x64 = Win8 Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Debug|Win32.ActiveCfg = Release|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Debug|Win32.Build.0 = Release|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Release|Win32.Build.0 = Release|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Release|x64.ActiveCfg = Release|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Vista Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Vista Debug|Win32.Build.0 = Debug|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Vista Debug|Win32.Deploy.0 = Debug|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Vista Debug|x64.ActiveCfg = Debug|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Vista Release|Win32.ActiveCfg = Release|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Vista Release|Win32.Build.0 = Release|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Vista Release|Win32.Deploy.0 = Release|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Vista Release|x64.ActiveCfg = Release|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Win7 Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Win7 Debug|Win32.Build.0 = Debug|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Win7 Debug|Win32.Deploy.0 = Debug|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Win7 Debug|x64.ActiveCfg = Debug|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Win7 Release|Win32.ActiveCfg = Release|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Win7 Release|Win32.Build.0 = Release|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Win7 Release|Win32.Deploy.0 = Release|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Win7 Release|x64.ActiveCfg = Release|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Win8 Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Win8 Debug|Win32.Build.0 = Debug|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Win8 Debug|Win32.Deploy.0 = Debug|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Win8 Debug|x64.ActiveCfg = Debug|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Win8 Release|Win32.ActiveCfg = Release|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Win8 Release|Win32.Build.0 = Release|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Win8 Release|Win32.Deploy.0 = Release|Win32
|
||||
{DCD73B97-0F44-4044-8BA4-95B59CCAB4BD}.Win8 Release|x64.ActiveCfg = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,7 @@
|
||||
This is the Microsoft "devcon" utility, which as far as I know is
|
||||
fair game to redistribute. It's packaged with OpenVPN and several
|
||||
other things and also distributed in source code form as an example
|
||||
program by Microsoft.
|
||||
|
||||
It's used to automatically install the Microsoft Loopback Adapter
|
||||
or remove it when no longer needed.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+20
-2
@@ -15,7 +15,12 @@
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#define fseeko _fseeki64
|
||||
#define ftello _ftelli64
|
||||
#endif
|
||||
|
||||
#define KISSDB_HEADER_SIZE ((sizeof(uint64_t) * 3) + 4)
|
||||
|
||||
@@ -42,10 +47,21 @@ int KISSDB_open(
|
||||
uint64_t *httmp;
|
||||
uint64_t *hash_tables_rea;
|
||||
|
||||
#ifdef _WIN32
|
||||
db->f = (FILE *)0;
|
||||
fopen_s(&db->f,path,((mode == KISSDB_OPEN_MODE_RWREPLACE) ? "w+b" : (((mode == KISSDB_OPEN_MODE_RDWR)||(mode == KISSDB_OPEN_MODE_RWCREAT)) ? "r+b" : "rb")));
|
||||
#else
|
||||
db->f = fopen(path,((mode == KISSDB_OPEN_MODE_RWREPLACE) ? "w+b" : (((mode == KISSDB_OPEN_MODE_RDWR)||(mode == KISSDB_OPEN_MODE_RWCREAT)) ? "r+b" : "rb")));
|
||||
#endif
|
||||
if (!db->f) {
|
||||
if (mode == KISSDB_OPEN_MODE_RWCREAT)
|
||||
if (mode == KISSDB_OPEN_MODE_RWCREAT) {
|
||||
#ifdef _WIN32
|
||||
db->f = (FILE *)0;
|
||||
fopen_s(&db->f,path,"w+b");
|
||||
#else
|
||||
db->f = fopen(path,"w+b");
|
||||
#endif
|
||||
}
|
||||
if (!db->f)
|
||||
return KISSDB_ERROR_IO;
|
||||
}
|
||||
@@ -322,6 +338,8 @@ int KISSDB_Iterator_next(KISSDB_Iterator *dbi,void *kbuf,void *vbuf)
|
||||
|
||||
#ifdef KISSDB_TEST
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
int main(int argc,char **argv)
|
||||
{
|
||||
uint64_t i,j;
|
||||
|
||||
@@ -34,7 +34,9 @@
|
||||
#include <stdexcept>
|
||||
#include <iostream>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "node/Constants.hpp"
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
#include <Windows.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
@@ -44,6 +46,8 @@
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
#include <openssl/rand.h>
|
||||
|
||||
#include "node/Node.hpp"
|
||||
#include "node/Utils.hpp"
|
||||
|
||||
@@ -51,6 +55,36 @@
|
||||
|
||||
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)
|
||||
@@ -81,6 +115,8 @@ int main(int argc,char **argv)
|
||||
signal(SIGQUIT,&sighandlerQuit);
|
||||
#endif
|
||||
|
||||
_initLibCrypto();
|
||||
|
||||
if (argc < 2) {
|
||||
printHelp(argv[0],stderr);
|
||||
return ZT_EXEC_RETURN_VALUE_NORMAL_TERMINATION;
|
||||
|
||||
@@ -225,7 +225,7 @@ int main(int argc,char **argv)
|
||||
response["nwid"] = request.get("nwid");
|
||||
response["type"] = "netconf-response";
|
||||
response["requestId"] = request.get("requestId");
|
||||
response["error"] = "NOT_FOUND";
|
||||
response["error"] = "OBJ_NOT_FOUND";
|
||||
std::string respm = response.toString();
|
||||
uint32_t respml = (uint32_t)htonl((uint32_t)respm.length());
|
||||
|
||||
|
||||
+1
-1
@@ -205,7 +205,7 @@ public:
|
||||
/**
|
||||
* @return True if this address is not zero
|
||||
*/
|
||||
inline operator bool() const throw() { return (_a); }
|
||||
inline operator bool() const throw() { return (_a != 0); }
|
||||
|
||||
/**
|
||||
* @return Sum of all bytes in address
|
||||
|
||||
+8
-1
@@ -94,7 +94,14 @@ public:
|
||||
inline reference back() throw() { return data[S-1]; }
|
||||
inline const_reference back() const throw() { return data[S-1]; }
|
||||
|
||||
inline bool operator==(const Array &k) const throw() { return std::equal(begin(),end(),k.begin()); }
|
||||
inline bool operator==(const Array &k) const throw()
|
||||
{
|
||||
for(unsigned long i=0;i<S;++i) {
|
||||
if (data[i] != k.data[i])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
inline bool operator<(const Array &k) const throw() { return std::lexicographical_compare(begin(),end(),k.begin(),k.end()); }
|
||||
inline bool operator!=(const Array &k) const throw() { return !(*this == k); }
|
||||
inline bool operator>(const Array &k) const throw() { return (k < *this); }
|
||||
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
throw()
|
||||
{
|
||||
n %= B;
|
||||
return (_field[n / 8] & (1 << (n % 8)));
|
||||
return ((_field[n / 8] & (1 << (n % 8))) != 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loaded 20 of 63 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user