Compare commits

...
599 Commits
Author SHA1 Message Date
Adam Ierymenko 7d951783ca A bunch of little warning removal and format fix things. 2020-12-04 15:52:30 -05:00
Adam Ierymenko ec76f6e1d2 Mirror over a few more AES fixes. 2020-12-03 22:29:38 -05:00
Adam Ierymenko c943d0e807 InetAddress fix ported from 1.6 2020-12-03 22:28:40 -05:00
Adam Ierymenko a1ceccaf6e Port back over some improvements from 1.6 2020-11-18 21:56:16 -05:00
Adam Ierymenko 326a871fac Mirror over Mac fixes. 2020-11-02 19:57:57 -05:00
Adam Ierymenko e462750bdd Remove unnecessary includes that are not needed. 2020-10-30 16:14:44 -04:00
Adam Ierymenko 7c599fe83e Typo / thinko 2020-10-27 10:41:46 -04:00
Adam Ierymenko d7e4404c17 A little more clarity to locator display. 2020-10-26 22:41:49 -04:00
Adam Ierymenko 441f4986ac Locator CLI plumbing. 2020-10-26 22:33:01 -04:00
Adam Ierymenko d70cfe6850 typo 2020-10-26 20:32:27 -04:00
Adam Ierymenko 4ed77e0c0f Upgrade Go modules. 2020-10-26 19:41:55 -04:00
Adam Ierymenko f8e3251efe Locator CGo API fixes. 2020-10-26 19:35:10 -04:00
Adam Ierymenko 1bb43476e8 Build fix, add Go unit tests for CGo Locator interface. 2020-10-26 18:44:45 -04:00
Adam Ierymenko 387d293793 Use Base32 everywhere for blobs to be consistent with core. 2020-10-23 18:10:25 -04:00
Adam Ierymenko bd96e53bcc Remove redundant includes. 2020-10-22 16:18:18 -04:00
Adam Ierymenko bab9a7f508 Fix and modernize API peer list function. 2020-10-22 15:53:35 -04:00
Adam Ierymenko 31eb950750 Missing flag. 2020-10-20 18:53:11 -04:00
Adam Ierymenko 31ef205828 ARM build fixes. 2020-10-16 18:29:16 -04:00
Adam Ierymenko a7350bc312 Bust out ARM crypto extensions AES into a separate file too. 2020-10-16 17:41:03 -04:00
Adam Ierymenko 0e396526e4 Some small Go stuff, and break out AES-NI into its own .cpp file for easier management. 2020-10-16 15:04:22 -04:00
Adam Ierymenko 8e5f8140a2 One more thing to move to CAPI.cpp. 2020-10-14 19:02:32 -04:00
Adam Ierymenko 8f746f5099 Move C API into its own source file, and fix some build flags to mirror fix in 1.6.0 to run on old Atom processors. 2020-10-14 18:10:59 -04:00
Adam Ierymenko bc8aa6c359 Mirror over some AES function attribute changes. 2020-10-13 16:10:53 -04:00
Adam Ierymenko 00714f5f2e cleanup 2020-10-08 19:03:46 -04:00
Adam Ierymenko d20470d30f cleanup 2020-09-18 19:54:27 -04:00
Adam Ierymenko c2d14599c5 Make protocol versions same as 1.x series. 2020-08-25 08:06:59 -07:00
Adam Ierymenko 896656115f Build fix for Go 1.15 2020-08-17 14:53:34 -07:00
Adam Ierymenko 72114e4cf8 Remove HTTP stuff from core API. This will be handled entirely in the service. 2020-08-13 17:46:58 -07:00
Adam Ierymenko 2abf2c5695 More certificate stuff... 2020-08-12 21:28:06 -07:00
Adam Ierymenko fe01352412 Cert CLI stuff, module bump. 2020-08-12 16:40:17 -07:00
Adam Ierymenko 782f15f8c9 Small software GMAC optimization. 2020-08-11 20:50:36 +00:00
Adam Ierymenko e0492a7e69 More Go CLI work, and some cleanup. 2020-08-11 13:24:27 -07:00
Adam Ierymenko cb147a3e8a Documentation in CLI, indicate what commands require a running node. 2020-08-10 16:04:05 -07:00
Adam Ierymenko f97e9e1f5d Warning removal, Go work... 2020-08-10 12:35:26 -07:00
Adam Ierymenko f1b6cb2ace GMAC is faster in software now. 2020-08-07 17:33:27 +00:00
Adam Ierymenko 27939a5233 AES performance on rpi4 is now at least acceptable. 2020-08-06 23:09:34 +00:00
Adam Ierymenko 7d5ba6f739 AES on pi4 2020-08-06 14:34:34 -07:00
Adam Ierymenko 37360d5e2e More test timing fixes. 2020-08-06 09:53:33 -07:00
Adam Ierymenko ae13983b10 Fix benchmarks to not take forever on slower chips. 2020-08-06 09:48:07 -07:00
Adam Ierymenko 78670aea58 AES software optimizations to make rpi4 faster. 2020-08-06 09:34:37 -07:00
Adam Ierymenko d0cc3ac333 Small AES optimizations on ARM64. 2020-08-03 23:14:02 +00:00
Adam Ierymenko 4273d89373 Linux/GCC fixes. 2020-07-31 16:18:06 -07:00
Adam Ierymenko 9ef780e05c Build fix-- these are not needed. 2020-07-31 15:48:18 -07:00
Adam Ierymenko 9da0b43d2d Fix some JSON names, regularize use of IP/port info in service code. 2020-07-31 15:32:09 -07:00
Adam Ierymenko 7c929099b3 Change date bump for v2.0 2020-07-31 14:26:55 -07:00
Adam Ierymenko ea2f95ed70 Optimizations, make Locator deserialize the same regardless of serialized field order. 2020-07-31 14:05:54 -07:00
Adam Ierymenko fc39894541 Small fix to reduce memory use a little bit more. 2020-07-31 13:53:11 -07:00
Adam Ierymenko 1fc4dce835 A bunch of cleanup, make Location serialization format saner, reduce core memory use. 2020-07-31 13:27:27 -07:00
Adam Ierymenko 0c56d7c769 Don't kick in AVX2/AVX512 VTEC unless the packet is larger than 256 bytes. 2020-07-30 10:02:37 -07:00
Adam Ierymenko 1f2a107d1d Some formatting. 2020-07-29 22:10:54 -07:00
Adam Ierymenko 4474303b01 Indent fix. 2020-07-29 21:59:53 -07:00
Adam Ierymenko 3b773da8bc Add separate accelerated() function for AES::GMAC. 2020-07-29 21:52:07 -07:00
Adam Ierymenko 7efaab2af1 Add 4X parallel ARM AES so VTEC will kick in, yo. Seems to help on Graviton, not much on small chips but thats okay. 2020-07-30 04:17:01 +00:00
Adam Ierymenko 064cb6dad7 AES-GMAC for ARM crypto extensions (pmull) 2020-07-30 03:45:40 +00:00
Adam Ierymenko d5afba2610 ARM auto-detection (unfinished) 2020-07-29 21:17:17 +00:00
Adam Ierymenko b4d0307d9e Some AES NEON reorg. 2020-07-29 13:37:32 -07:00
Adam Ierymenko 71b72a1ef2 AES (but not yet GMAC) for ARM64 native AES intrinsics, performs really well! 2020-07-29 20:10:27 +00:00
Adam Ierymenko b0e8bac310 Add CMake options to automatically add AArch64 flags for crypto enable, etc. 2020-07-29 09:13:55 -07:00
Adam Ierymenko 9a501a76d1 Starting on AES ARM intrinsics work. 2020-07-28 20:44:19 -07:00
Adam Ierymenko becc4aa8ea More certificate plumbing. 2020-07-28 14:38:41 -07:00
Adam Ierymenko 95d7970f34 Compiler flags, docs. 2020-07-28 09:41:43 -07:00
Adam Ierymenko 81530e5990 Certificate plumbing in Go. 2020-07-27 16:45:43 -07:00
Adam Ierymenko 825b19aedc Code readability improvement. 2020-07-23 15:13:42 -07:00
Adam Ierymenko 0f04b5afc7 Add CRL fields to Go shadow of Certificate. 2020-07-23 15:05:12 -07:00
Adam Ierymenko 189dea7c96 Certificate work, and add an Endpoint attributes field to Locator for future use. 2020-07-22 20:38:57 -07:00
Adam Ierymenko 85ef9535d5 So that's where those NULLs came from... 2020-07-17 21:12:28 -07:00
Adam Ierymenko 71a2206c5d Move a few things. 2020-07-17 10:57:01 -07:00
Adam Ierymenko 641d1a52c8 Warning removal. 2020-07-17 10:49:53 -07:00
Adam Ierymenko 407f737212 A bunch of Topology simplification, integrate some cert and root changes. 2020-07-16 20:04:05 -07:00
Adam Ierymenko 0d58865061 Fix certificte self-test. 2020-07-16 12:30:09 -07:00
Adam Ierymenko cfb0bc4f8e Better CRL implementation, AES fix. 2020-07-16 12:01:24 -07:00
Adam Ierymenko dfe230be8b CRL support 2020-07-16 10:51:54 -07:00
Adam Ierymenko 75ecfffd52 More tweaks. 2020-07-15 16:51:39 -07:00
Adam Ierymenko 883cbd182d Some optimization work on crypto code. 2020-07-15 14:33:02 -07:00
Adam Ierymenko 866a20e85b More small stuff. 2020-07-14 16:34:46 -07:00
Adam Ierymenko a19bc1e826 Cleanup, remove legacy accessors, formatting. 2020-07-14 16:23:53 -07:00
Adam Ierymenko a117c92a1e Module update for Go code. 2020-07-13 15:53:49 -07:00
Adam Ierymenko 65ef40b091 Some Go reorg. 2020-07-13 15:44:54 -07:00
Adam Ierymenko 15f5125c8c Hide some low-level stuff from public certificate API in Go. 2020-07-13 14:54:53 -07:00
Adam Ierymenko e5f2314055 Fix another not-fun bug. Also exterminate a memory leak and do a few optimizations. 2020-07-10 16:38:32 -07:00
Adam Ierymenko f018fefeb4 Even less bugs! 2020-07-09 20:08:08 -07:00
Adam Ierymenko 04d8c3dd79 Now with less bugs! 2020-07-09 14:57:44 -07:00
Adam Ierymenko 7994e3aa78 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-07-09 10:12:31 -07:00
Adam Ierymenko 1eacbdf374 Some cleanup, and fix a really obscure bug in Certificate. 2020-07-09 10:12:24 -07:00
Grant Limberg 492e78e2cf back to not building all archs by default 2020-07-08 10:27:41 -07:00
Adam Ierymenko 8b1c691a5e Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-07-07 10:12:49 -07:00
Adam Ierymenko b02fc1f28b CGo hell, fix a thinko in CMakeFile. 2020-07-07 10:12:38 -07:00
Grant Limberg ecf1fe9aa5 had these transposed 2020-07-07 08:57:53 -07:00
Adam Ierymenko 7e341ed397 More certificate plumbing. 2020-07-06 19:28:43 -07:00
Adam Ierymenko e5e6f82a8e Windows build fix. 2020-07-06 15:28:25 -07:00
Adam Ierymenko eca929faef Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-07-06 15:16:05 -07:00
Adam Ierymenko b027a83789 Minor stuff... 2020-07-06 15:15:21 -07:00
Grant Limberg 1ad0fbdb76 Revert "fix compilation of zt_service_tests on Windows"
This reverts commit 8f1e6a2fde.
2020-07-06 15:04:46 -07:00
Grant Limberg 8f1e6a2fde fix compilation of zt_service_tests on Windows 2020-07-06 12:45:06 -07:00
Adam Ierymenko 451e6be180 Evil not very fun CGO glue for Certificate works! Also added a self-test project for Go code. Not using "go test" because of CMake build and CGO linking requirements that make it a pain in the derriere. 2020-07-03 16:05:43 -07:00
Adam Ierymenko 7b869684c6 More cert Go plumbing. 2020-07-03 14:42:29 -07:00
Adam Ierymenko 0d764f5a3d CGO glue for certificates, and Go formatting and other boring stuff. 2020-07-03 13:08:40 -07:00
Adam Ierymenko 899f0c9749 Certificate API 2020-07-02 22:22:31 -07:00
Adam Ierymenko 727aa8e71f Warning removal. 2020-07-02 15:03:12 -07:00
Adam Ierymenko 404b7a5493 Even more clever... and would crash if something weird happened, which is desirable. 2020-07-02 13:58:31 -07:00
Adam Ierymenko befc50ac3a Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-07-02 13:57:32 -07:00
Adam Ierymenko 94c35d395e A bit more optimization/cleanup. 2020-07-02 13:57:19 -07:00
Grant Limberg 7883e5d8ad Fix cast order of operations 2020-07-02 13:28:58 -07:00
Adam Ierymenko 97cd184211 cleanup 2020-07-02 13:09:59 -07:00
Adam Ierymenko c17ac16728 Windows fix. 2020-07-02 11:53:47 -07:00
Adam Ierymenko b696ab12b8 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-07-02 11:52:34 -07:00
Adam Ierymenko e7ccd74a9e Disable functions missing in MinGW 2020-07-02 11:52:20 -07:00
Grant Limberg 676a3444cd fix s390x static section of jenkinsfile 2020-07-02 11:19:35 -07:00
Adam Ierymenko bd0299f392 Some cleanup and optimization. 2020-07-02 10:33:34 -07:00
Adam Ierymenko e213317532 -lm is needed on some platforms, harmless on others 2020-07-01 12:38:22 -07:00
Adam Ierymenko 206524b9e6 BSD fixes. 2020-07-01 12:30:41 -07:00
Adam Ierymenko 7a458e0138 BSD fixes. 2020-07-01 12:28:44 -07:00
Adam Ierymenko 9db9211ed3 Fix method name problem. 2020-07-01 11:14:01 -07:00
Adam Ierymenko 2ee550bbfd Some optimization. 2020-06-30 23:44:24 -07:00
Adam Ierymenko 9029570452 Test certificate copy/construct. 2020-06-30 23:20:50 -07:00
Adam Ierymenko 6af39da61a Some formatting and optimization. 2020-06-30 22:23:57 -07:00
Adam Ierymenko ad692b07c3 Add CPUID output to self-test. 2020-06-30 20:51:14 -07:00
Adam Ierymenko 3f4809457f A bunch of compile fixes, and an edge case fix in Dictionary. 2020-06-30 20:31:41 -07:00
Adam Ierymenko 53b85a2bbb Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-06-30 11:20:50 -07:00
Adam Ierymenko 92d2bbc63c Some symbol renaming, performance improvements, a bug fix for compiling on some platforms, and some Topology work. 2020-06-30 11:20:44 -07:00
Grant Limberg 536be73006 s390x all static 2020-06-30 11:06:33 -07:00
Grant Limberg 115187204f remove debug output 2020-06-30 10:04:19 -07:00
Grant Limberg b482064a55 reenable some temporarily disabled stuff 2020-06-30 09:59:18 -07:00
Grant Limberg 722a50f7be armel image build shortcut 2020-06-29 17:15:18 -07:00
Grant Limberg 623213ea0b fix wheezy symlink 2020-06-29 17:13:56 -07:00
Grant Limberg 0589c4ab6a fix stretch symlink 2020-06-29 17:12:52 -07:00
Grant Limberg 46c4a11a7a fix jessie symlink 2020-06-29 17:11:55 -07:00
Grant Limberg 16d27dfddb fix buster ld symlink 2020-06-29 17:09:15 -07:00
Grant Limberg aee344fe47 kill a couple docker images 2020-06-29 15:18:01 -07:00
Grant Limberg 696c77f5c8 no static builds for armel
no support in Alpine, can't build it
2020-06-29 14:50:52 -07:00
Grant Limberg 8921914098 force use of vendored modules 2020-06-29 14:24:06 -07:00
Grant Limberg f33574dfbc needed on Jessie, too 2020-06-29 13:29:33 -07:00
Grant Limberg e2bc081740 hack to run go on armel containers 2020-06-29 13:17:20 -07:00
Grant Limberg a6d7f7cac2 -latomic for armel 2020-06-29 12:19:25 -07:00
Grant Limberg c714112e00 fix building cmake on arm32 2020-06-29 09:23:48 -07:00
Adam Ierymenko bae91724a1 Certificate passes all tests. 2020-06-27 14:52:55 -07:00
Adam Ierymenko daef6a24d1 Now with less bugs, and less limits that could pose an issue later. 2020-06-27 13:52:12 -07:00
Adam Ierymenko 661ebfee94 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-06-26 13:09:35 -07:00
Adam Ierymenko 73d0e2e7e0 Interim commit of some cert and cert testing work, also other cleanup in Utils. 2020-06-26 13:09:24 -07:00
Grant Limberg 917cc58560 Only build problems left are the compiler errors adam has tickets for 2020-06-25 18:01:27 -07:00
Grant Limberg 1eea80194b apparently not in backports as advertised 2020-06-25 15:40:10 -07:00
Grant Limberg d569217ff5 echo, not cat 2020-06-25 15:38:21 -07:00
Grant Limberg d823725eb6 update alpine base image 2020-06-25 15:23:09 -07:00
Grant Limberg f08d20560b stretch has mips golang 1.11 in backports
don't know if it'll work though
2020-06-25 15:15:16 -07:00
Grant Limberg c0385466e2 no golang packages for buster or stretch on mips64
no mips on stretch at all
2020-06-25 15:07:12 -07:00
Grant Limberg c22b002226 Looks like we have to turn off bullseye 32-bit ARM too 2020-06-25 14:55:01 -07:00
Grant Limberg 9aac1fc47f default BUILD_ALL flag to true for now
since that's what I"m testing now
2020-06-25 14:52:08 -07:00
Grant Limberg 39d4fadf90 add mips64le to debian native build lists 2020-06-25 11:56:32 -07:00
Grant Limberg 4968afb89a no 32-bit arm on sid for the time being 2020-06-25 11:41:09 -07:00
Grant Limberg 8b45018f28 remove ldflag on windows 2020-06-25 09:39:06 -07:00
Grant Limberg 007b3bd10b openssl dev for sid 2020-06-25 08:49:23 -07:00
Adam Ierymenko 5e1b7f2ba6 Certificate stuff, but not plumbled through to CLI yet to actually make them. 2020-06-25 07:40:21 -07:00
Adam Ierymenko 40820ddea9 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-06-24 17:08:19 -07:00
Adam Ierymenko 4fbc29158d A few more things to manually merge in CMakeLists.txt 2020-06-24 17:08:11 -07:00
Adam Ierymenko 6e1115ea03 More cert work, support certs in data store, and manually merge CMakefile. 2020-06-24 17:05:34 -07:00
Grant Limberg d5d1f4a313 forgot the -y on apt-get 2020-06-24 14:59:38 -07:00
Grant Limberg 1e65aad95b args 2020-06-24 14:53:02 -07:00
Grant Limberg 495ac17346 debian mips64 image fixes 2020-06-24 14:51:59 -07:00
Grant Limberg 2f82db97ed blah 2020-06-24 14:46:30 -07:00
Grant Limberg 35f3d16084 bullseye base version 2020-06-24 14:23:30 -07:00
Grant Limberg 29dfe240e4 mips64le updates 2020-06-24 14:21:47 -07:00
Adam Ierymenko aa9ca845e8 Merge edge, still need to resolve CMakeLists.txt 2020-06-24 10:50:16 -07:00
Adam Ierymenko 05a3831acb Certificates, and rename credentials to credential since they are not truly certificates (according to the common definition). 2020-06-24 10:46:59 -07:00
Grant Limberg 9a7d26cd9e fix package name 2020-06-24 10:07:08 -07:00
Grant Limberg ab36607a48 docker & build parallelization 2020-06-24 09:57:38 -07:00
Grant Limberg 02a810b8d6 same issue on sid, apparently 2020-06-23 17:18:54 -07:00
Grant Limberg 2d1ca5f346 cmake version from debian-bullseye doesn't like ARM
so let's build the latest from src
2020-06-23 17:12:52 -07:00
Grant Limberg 65aca7d84a let's not force the build server to swap out when building releases 2020-06-23 16:48:50 -07:00
Grant Limberg d3a9ce95bc more flag fixes 2020-06-23 16:41:55 -07:00
Grant Limberg ee53f056ce fix flags 2020-06-23 16:29:35 -07:00
Grant Limberg f3defdf3a6 one more 2020-06-23 14:42:18 -07:00
Grant Limberg 6d88a13407 fix variable 2020-06-23 14:28:32 -07:00
Grant Limberg 9722bdef75 fix variable name 2020-06-23 13:33:59 -07:00
Grant Limberg f87e41abee jenkinsfile armhf/armel stuff 2020-06-23 12:56:29 -07:00
Grant Limberg d7c6f8ae3f armel/armhf differentiation in builds 2020-06-23 11:49:43 -07:00
Grant Limberg 4d80f7c41d more go static build flags 2020-06-23 09:53:46 -07:00
Grant Limberg de00486b80 no armhf for ubuntu focal 2020-06-23 09:41:45 -07:00
Grant Limberg c2664033bc try to force 32-bit package for centos7 i386 2020-06-23 09:04:45 -07:00
Grant Limberg f96a9f63ea . 2020-06-23 08:53:13 -07:00
Grant Limberg 78b18f2bdb remove centos6 from jenkinsfile 2020-06-23 08:40:24 -07:00
Grant Limberg 8bb0753f62 get cmake from yum for centos8 2020-06-22 16:23:34 -07:00
Grant Limberg 0c5d1a793c fix docker images for static targets 2020-06-22 15:58:49 -07:00
Grant Limberg 34692489cb RIP Centos 6 2020-06-22 15:18:30 -07:00
Grant Limberg 52b619b38f temporarily disable builds of Debian Stretch, FreeBSD, Ubuntu Bionic AMD64, and Ubuntu Xenial 2020-06-22 14:34:23 -07:00
Grant Limberg 9009a864ab re-enable static build packaging with updates 2020-06-22 14:03:27 -07:00
Grant Limberg 09a8b66d3b enable -DPACKAGE_STATIC=1 builds
Only configures the project for packaging of the statically built binary placed in build/
2020-06-22 13:50:35 -07:00
Grant Limberg 7c6f5e2c37 make install works on Linux 2020-06-22 11:00:48 -07:00
Grant Limberg 930bd91598 finish up rpm generation 2020-06-22 09:49:25 -07:00
Grant Limberg 050615f2d2 fix centos7 x64 2020-06-19 16:50:42 -07:00
Grant Limberg 05cc4ea36a dont use __has_include 2020-06-19 16:36:04 -07:00
Grant Limberg 4cafc1b776 extraneous ` in rpm building 2020-06-19 16:32:43 -07:00
Grant Limberg fb559434b6 jenkins builds rpms 2020-06-19 16:24:32 -07:00
Grant Limberg 02493d473f basic RPM package
still needs systemd/init scripts
2020-06-19 16:21:47 -07:00
Grant Limberg 1abcb5adf5 parallelize make 2020-06-19 15:42:33 -07:00
Grant Limberg 1b8703db95 add cmake package args 2020-06-19 15:40:48 -07:00
Grant Limberg 517a171a6c dont split debian description over multiple lines 2020-06-19 15:35:42 -07:00
Grant Limberg b126bf727a non-static build debian packages 2020-06-19 15:33:08 -07:00
Adam Ierymenko cfc2a43f51 A whole bunch of minor refactoring, and rename a bunch of classes to be more canonical. A credential really is not a certficiate, so just call IdentificationCertificate Certificate and call the network auth stuff credentials. 2020-06-18 17:02:36 -07:00
Grant Limberg 0477e16860 freebsd doesn't like the root makefile 2020-06-18 16:31:15 -07:00
Grant Limberg cc13bf1049 fix jenkinsfile 2020-06-18 15:35:35 -07:00
Grant Limberg a66b4a6f5e add freebsd build target 2020-06-18 15:26:29 -07:00
Grant Limberg f989758159 parallelize windows build 2020-06-18 13:46:57 -07:00
Grant Limberg ade8373c0c because reasons 2020-06-18 13:44:19 -07:00
Grant Limberg fa4ecea095 wtf 2020-06-18 13:34:01 -07:00
Grant Limberg 7ae9c6d55c . 2020-06-18 13:19:30 -07:00
Grant Limberg b369d4b9a1 fix 32-bit windows build 2020-06-18 13:01:05 -07:00
Grant Limberg ea5bb43cf9 windows 32bit builds 2020-06-18 11:58:00 -07:00
Grant Limberg 6ea60bc429 let's see if paths with no spaces works 2020-06-18 11:26:57 -07:00
Grant Limberg b094278b64 explicitly set SHELL environment variable 2020-06-18 10:59:46 -07:00
Grant Limberg f21384e499 windows fun 2020-06-18 10:54:31 -07:00
Grant Limberg 620fa9ab54 🤷‍♂️ 2020-06-17 13:26:36 -07:00
Grant Limberg d8c83dbb08 pita 2020-06-17 13:18:01 -07:00
Grant Limberg 992d1471b8 add CMake and Go to Windows PATH 2020-06-17 12:29:03 -07:00
Grant Limberg 27b14aefcd help it find cmd.exe 2020-06-17 12:19:06 -07:00
Grant Limberg a7fee6b02f playing with paths 2020-06-17 12:14:50 -07:00
Grant Limberg cea297b69d enable windows builds 2020-06-17 12:04:29 -07:00
Adam Ierymenko c348bfff30 Fix quote craziness. 2020-06-16 22:33:43 -07:00
Adam Ierymenko 224c468aa3 OMG Windows builds! 2020-06-16 22:26:47 -07:00
Adam Ierymenko a472aafb3e Windows now builds at least to the point of running zt_core_tests. Go will need a revision to the command in CMake files. 2020-06-16 21:21:24 -07:00
Grant Limberg b165b9dd4f another fix 2020-06-16 17:46:22 -07:00
Grant Limberg 7d388e0c79 fix mac jenkins 2020-06-16 17:34:58 -07:00
Grant Limberg 4036657e32 add macos build to jenkins 2020-06-16 16:13:01 -07:00
Grant Limberg d50c6ee1ce need ssl dev 2020-06-16 15:07:31 -07:00
Adam Ierymenko 143f4bef9f Select the right C++ library, hopefully. 2020-06-16 15:00:59 -07:00
Adam Ierymenko 765dc413db Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-06-16 15:00:25 -07:00
Grant Limberg 423b0d891c need stdint.h on Windows, too 2020-06-16 14:48:27 -07:00
Grant Limberg 3db0e9d068 use correct dockerfile for Xenial x64 2020-06-16 14:07:40 -07:00
Grant Limberg 1f3f9bc341 for ptrdiff_t 2020-06-16 13:52:26 -07:00
Grant Limberg e84bfca5a5 xenial needs newer cmake, too 2020-06-16 13:45:35 -07:00
Adam Ierymenko bd488a08f8 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-06-16 13:36:48 -07:00
Adam Ierymenko 3c6448a717 Move all CGO flags into CMakeLists.txt so they can inherit all our system detection and stuff. 2020-06-16 13:36:43 -07:00
Grant Limberg 0a2dfc719a fix centos 7 & debian stretch 2020-06-16 13:33:05 -07:00
Adam Ierymenko f0fc4713d8 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-06-16 13:01:20 -07:00
Grant Limberg b2132aa975 needs libssl dev 2020-06-16 12:19:31 -07:00
Grant Limberg 7739984c56 typo 2020-06-16 12:11:48 -07:00
Grant Limberg 034188b0ee reset WORKDIR back to root once built 2020-06-16 12:07:20 -07:00
Grant Limberg 98ea27ecb0 have to build & install cmake on non-x64 versions of debian stretch 2020-06-16 11:59:08 -07:00
Adam Ierymenko 8d2a0f764b Some minor reorg. 2020-06-16 11:51:41 -07:00
Grant Limberg 6c43e0b946 add scl-utils 2020-06-16 11:28:42 -07:00
Grant Limberg 77342f8571 try setting scl_source on centos7 for newer compilers 2020-06-16 10:40:01 -07:00
Grant Limberg e808b4b45f add ubuntu focal builds 2020-06-16 10:26:48 -07:00
Grant Limberg 86d91cb625 no ubuntu 20.04 for ArmV7 2020-06-16 10:10:51 -07:00
Grant Limberg 3f21e59ab4 more DEBIAN_FRONTEND=noninteractive 2020-06-16 09:53:42 -07:00
Grant Limberg 3669cac3c9 apparently apt now asks for your region interactively. Even in a docker image 2020-06-16 09:50:16 -07:00
Grant Limberg b919f5a95b helps to load the correct dockerfile 2020-06-16 09:46:42 -07:00
Grant Limberg 5e6484ff5a add docker images for ubuntu 20.04 2020-06-16 09:08:26 -07:00
Adam Ierymenko ecb09aa2e1 Fix bounds check bug. 2020-06-15 16:30:52 -07:00
Adam Ierymenko 346d4b572b Fix symbol issues in static build. 2020-06-15 15:02:07 -07:00
Grant Limberg 1a38dfdbde back to go main 2020-06-15 13:51:24 -07:00
Adam Ierymenko 69f1c8701b Define uint since that is not a standard symbol. 2020-06-15 13:13:03 -07:00
Adam Ierymenko 9daf4540de Certificates, and it builds again. 2020-06-15 11:17:24 -07:00
Adam Ierymenko f447608d6b Certificates, etc... work in progress. 2020-06-13 21:41:39 -07:00
Grant Limberg 001fb54b15 fix go static command line 2020-06-12 16:08:34 -07:00
Grant Limberg ffc786d796 update make call for static 2020-06-12 15:59:53 -07:00
Grant Limberg a1649d6cda trying again for static build. also add static go flags 2020-06-12 15:58:00 -07:00
Grant Limberg 541b2cbef0 . 2020-06-12 15:49:28 -07:00
Grant Limberg 5166aa6913 added static build option 2020-06-12 15:43:12 -07:00
Grant Limberg b88000c349 . 2020-06-12 15:39:02 -07:00
Grant Limberg 49eefe7e78 rename error for static 2020-06-12 15:31:34 -07:00
Grant Limberg bfdac7a8f0 use alpine go package 2020-06-12 15:21:48 -07:00
Grant Limberg d9dd77bc6e let cgo find versionl.h 2020-06-12 15:09:31 -07:00
Grant Limberg e46a342e17 ensure version.h is in the include path 2020-06-12 14:57:41 -07:00
Grant Limberg 760607f58a static alpine builds reenabled 2020-06-12 14:46:48 -07:00
Grant Limberg 35b5780907 remove __has_include 2020-06-12 14:44:25 -07:00
Grant Limberg 51159601b0 one more time 2020-06-12 14:27:34 -07:00
Grant Limberg 4cb35a2975 yes pipe too 2020-06-12 13:58:50 -07:00
Grant Limberg 405250ce79 tell curl to follow redirects 2020-06-12 13:56:44 -07:00
Grant Limberg 81b11168c9 centos 8 update 2020-06-12 13:48:31 -07:00
Grant Limberg 066cdfe2ac alternate newer cmake install 2020-06-12 13:46:40 -07:00
Grant Limberg 062189b589 add sid 32bit 2020-06-12 11:40:34 -07:00
Grant Limberg a11d0027ce cast to uintptr_t instead
should fix non 64-bit platforms
2020-06-12 09:22:58 -07:00
Grant Limberg c9ae7e811f Should fix non x64 platforms
Need adam to check
2020-06-12 09:22:17 -07:00
Grant Limberg 47ec246520 try to force 32 bit with BUILD_32BIT flag. force VERBOSE=1 cmake build too 2020-06-10 16:19:39 -07:00
Grant Limberg 42104cfc4c go wrangling 2020-06-10 15:56:16 -07:00
Grant Limberg 1bab9b202f default off 2020-06-10 15:40:14 -07:00
Grant Limberg 74ce98f39b set CMAKE_SYSTEM_PROCESSOR to x86 2020-06-10 15:39:48 -07:00
Grant Limberg 3268effabf enable 32bit builds on 64-bit hosts 2020-06-10 15:31:40 -07:00
Grant Limberg 96965647bc wtf 2020-06-10 14:51:44 -07:00
Grant Limberg 808ab715d9 forgot to save a few files 2020-06-10 13:02:38 -07:00
Grant Limberg fa1e16085b permissions in docker containers 2020-06-10 12:40:44 -07:00
Grant Limberg dd46e56af2 add include <mmintrin.h> 2020-06-10 12:27:22 -07:00
Grant Limberg d8d871745e add cmake 2020-06-10 10:50:01 -07:00
Grant Limberg 09c9e338bc needs /bin? 2020-06-10 09:51:57 -07:00
Grant Limberg df9483408d CMake error if go not found 2020-06-10 09:33:48 -07:00
Grant Limberg cb342bfb12 make GCC happy 2020-06-09 15:30:01 -07:00
Grant Limberg 04266a1180 don't build static binaries yet. Don't have the build config in there for it yet 2020-06-09 14:49:37 -07:00
Grant Limberg 86eda5fe65 use zerotier as binary name for 2.0 2020-06-09 14:31:00 -07:00
Grant Limberg bc1fa3bf20 make it easier to update go version for docker build containers 2020-06-09 14:29:40 -07:00
Grant Limberg e63920404c copy over dockerbuild files for releases 2020-06-09 14:16:36 -07:00
Grant Limberg 4833478eee Fix linux link ordering and add Dockerfile for central controllers
Builds but obviously won't actually do anything yet
2020-06-09 14:14:11 -07:00
Grant Limberg c8b6850520 add central controller build target 2020-06-09 14:14:06 -07:00
Adam Ierymenko 938cbba449 Root set stuff, code formatting and other boring stuff. 2020-06-09 12:26:52 -07:00
Grant Limberg c8f640f3f2 compile go code to static library & call via main.cpp
This allows CMake to manage the linkage of C/C++ libraries rather than an exponentially growing list of cgo directives based on build options
2020-06-09 12:03:16 -07:00
Grant Limberg 2272189955 macOS: link static versions of lipq and libhiredis on mac
will need to grab them via homebrew
2020-06-08 16:14:01 -07:00
Grant Limberg 736edeeed0 figure out conditional compilation & cgo based on go build tags 2020-06-08 15:54:10 -07:00
Adam Ierymenko bf33368add Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-06-08 14:45:08 -07:00
Adam Ierymenko 40d48c969c Some cleanup, revision to Endpoint string format, stub out HTTP API callbacks. 2020-06-08 14:41:13 -07:00
Grant Limberg 17f0dc9ba2 2.0 compiles with postgres/redis controller code
Probably doesn't work yet
2020-06-08 14:11:07 -07:00
Adam Ierymenko 016d85b169 Code formatting and similar. 2020-06-08 11:47:28 -07:00
Grant Limberg 2bceabdfa5 add redis dependencies for central controller 2020-06-08 11:23:41 -07:00
Adam Ierymenko d18c33d6df Code cleanup, Linux build fixes. 2020-06-05 22:18:58 -07:00
Adam Ierymenko e2ca065f28 Cleanup, revise join command 2020-06-05 16:36:31 -07:00
Adam Ierymenko fe28501126 Also clean CLion directories. 2020-06-05 14:40:04 -07:00
Adam Ierymenko 73795d05eb Reorg done and builds 2020-06-05 14:38:35 -07:00
Adam Ierymenko af846f7e3f Fix clean 2020-06-05 13:45:43 -07:00
Adam Ierymenko a0374da4f3 Reorg. 2020-06-05 13:42:34 -07:00
Adam Ierymenko 4e44fa009c Clean up gitignore 2020-06-05 13:31:10 -07:00
Adam Ierymenko 3dd2c94f4e Moar reorganization. 2020-06-05 13:26:35 -07:00
Adam Ierymenko 6da8f2bb05 Temporarily stash stuff in attic that needs update before beta/release. 2020-06-05 13:06:01 -07:00
Adam Ierymenko e21fcb8104 Reorg. 2020-06-05 13:05:28 -07:00
Adam Ierymenko 3c11c13af4 More reorg, work in progress. 2020-06-05 13:04:37 -07:00
Adam Ierymenko d3cf7b2202 Reorg. 2020-06-05 12:56:20 -07:00
Adam Ierymenko 03bcdf74a8 Some CLI help updates, some code formatting, pre-reorg. 2020-06-05 12:49:35 -07:00
Adam Ierymenko 45b90a0dfa Formatting and boring stuff 2020-06-05 10:41:32 -07:00
Adam Ierymenko 9babfcb9b6 A bunch more go plumbing. 2020-06-04 16:03:11 -07:00
Adam Ierymenko 1b2a4f00f2 Take like ten on the addRoot thing, making it even simpler. Explicit locator commands are still present but they will remain just for use in creating subscriptions etc. 2020-06-04 10:32:13 -07:00
Adam Ierymenko 90b5acfca6 Docs, simplification. 2020-06-04 07:16:15 -07:00
Adam Ierymenko 741f7814c2 Various build fixes. 2020-06-03 22:15:19 -07:00
Adam Ierymenko a4ae4941c3 Try to ignore temporary IPv6 addresses, fix Peer serialization, add an endpoint cache to Peer, some more Go stuff. 2020-06-03 22:03:34 -07:00
Adam Ierymenko 8a6ef33c4a revert 2020-06-03 12:27:35 -07:00
Adam Ierymenko 5ac2596429 More CLI work, link go.mod and go.sum for some Go editors to work. 2020-06-03 11:59:24 -07:00
Adam Ierymenko 5dac2e82a7 A bunch of tweaks around CLI parameters and string formats of things. 2020-06-02 11:37:04 -07:00
Adam Ierymenko 8e29acd664 Causes build problems, revert. 2020-06-01 16:24:12 -07:00
Adam Ierymenko 1d29bc3e8e Move go.mod and go.sum into base. 2020-06-01 16:07:49 -07:00
Adam Ierymenko dc1ef0c49e Code formatting and other boring stuff. 2020-06-01 15:40:00 -07:00
Adam Ierymenko 1003455160 Cleanup. 2020-05-31 15:30:24 -07:00
Adam Ierymenko 20ae12d385 Clean up some NAT traversal code, modify algorithm to eliminate the need for toggle-able options. 2020-05-31 15:11:47 -07:00
Adam Ierymenko dcc686a3a7 Docs, YAGNI removal, use locator endpoints in peer contact attempts. 2020-05-31 06:47:56 -07:00
Adam Ierymenko 89c27c112a Flesh out tests, fix a signing bug. 2020-05-30 19:08:45 -07:00
Adam Ierymenko 3621fe8897 Some AES cleanup and include controller with Go build. 2020-05-30 17:03:12 -07:00
Adam Ierymenko 33269cd29d Some CGo fixes. 2020-05-30 12:07:52 -07:00
Adam Ierymenko 1970dab13d Move some toString/fromString to C++ since any ZT code base would need it, and stub out the controller commands. 2020-05-30 11:42:59 -07:00
Adam Ierymenko a5390b1bc8 Plumb new locator code through to Go, fix some cgo issues, fix some compiler warnings. 2020-05-29 10:16:38 -07:00
Adam Ierymenko 864e33cf2d A bunch of build fixes. 2020-05-29 07:06:00 -07:00
Adam Ierymenko b9bf6d1242 Simplification of addRoot/removeRoot, and some code reformatting and other cleanup across multiple files. 2020-05-29 06:30:02 -07:00
Adam Ierymenko caad356b93 A bunch of go fixes, wire up root add/delete. 2020-05-25 18:05:34 -07:00
Adam Ierymenko 964c235ecf Golang fixes 2020-05-25 14:23:48 -07:00
Adam Ierymenko c881094202 Warning removal. 2020-05-25 09:55:47 -07:00
Adam Ierymenko 6051c973d3 A bunch of warning removal, build fixes, and cleanup. 2020-05-25 09:48:18 -07:00
Adam Ierymenko 1f9717250c Update release notes, rip out trusted paths which were clunky and rarely used and of dubious value, and some other cleanup. 2020-05-21 13:04:27 -07:00
Adam Ierymenko 8ebbbc33cc Clean up and revise how roots are added/specced. 2020-05-21 11:21:39 -07:00
Adam Ierymenko 98bcff1928 Warning fix. 2020-05-19 15:03:30 -07:00
Adam Ierymenko cef708c8ad Build fixes. 2020-05-19 15:01:52 -07:00
Adam Ierymenko a925e2d783 Build fixes. 2020-05-19 14:02:32 -07:00
Adam Ierymenko a1193f0e30 A few AES-GMAC-SIV tweaks to use a bit more IV state. 2020-05-19 12:18:50 -07:00
Adam Ierymenko f209037efe Cleanup, slightly slow down V1 identity generation, faster Salsa20 (by a bit). 2020-05-19 10:13:12 -07:00
Adam Ierymenko b99dd7d916 Fix code generation for AES stuff so it runs on chips that do not have AVX or VAES. 2020-05-18 16:50:05 -07:00
Adam Ierymenko aad21cf395 Blazing fast VAES (256 and 512) AES-CTR, Identity fixes, test fixes. 2020-05-18 16:29:41 -07:00
Adam Ierymenko d537428421 Build fixes. 2020-05-18 09:44:23 -07:00
Adam Ierymenko 996589894d Build fixes 2020-05-14 11:53:45 -07:00
Adam Ierymenko d3777b3eb4 A bunch of boring formattings stuff, etc. 2020-05-14 10:55:41 -07:00
Adam Ierymenko 52e1f5502d More VL1 work after re-re-re-refactor... 2020-05-13 14:26:53 -07:00
Adam Ierymenko 664a128e9e Yet more work in progress... mostly cleanup and re-implementation without depending on struture padding. 2020-05-11 13:08:55 -07:00
Adam Ierymenko 666d44b14a More endless work in progress... 2020-05-06 10:42:09 -07:00
Adam Ierymenko b533c300d8 A ton more work... almost there 2020-04-28 19:52:09 -07:00
Adam Ierymenko 78d223d709 A bunch more cleanup, remove a ton of reinterpret_cast cruft in favor of a simple union in InetAddress. 2020-04-16 16:01:39 -07:00
Adam Ierymenko 2b0127c26d Work in progress on crypto stuff, refactoring to back out of use of structs for encode/decode as it is questionably portable. 2020-04-16 12:34:51 -07:00
Adam Ierymenko 16a3c14c53 A bunch of cleanup and refactoring, implementation of prep for forward secrecy still in progress. 2020-04-13 12:22:08 -07:00
Adam Ierymenko c65391a344 Add symmetric key container, tons of cleanup. 2020-04-06 16:54:35 -07:00
Adam Ierymenko fbf4ae823b Clean up timing stuff in Peer and make it more rational, implement some more P2P stuff, rename some methods, cleanup cleanup cleanup. 2020-04-03 10:18:46 -07:00
Adam Ierymenko 3d6d9c5808 LINT cleanliness. 2020-03-31 14:30:02 -07:00
Adam Ierymenko 64c533c189 More warning removal. 2020-03-31 14:09:17 -07:00
Adam Ierymenko 7fd78a87d1 Use static_assert more. 2020-03-31 13:45:05 -07:00
Adam Ierymenko b9f60fc3c2 A bunch of warning removal and LINT cleanliness. 2020-03-31 12:35:54 -07:00
Adam Ierymenko afa01074c5 File this idea away. 2020-03-31 11:03:02 -07:00
Adam Ierymenko 1f85b0402e Just use unordered_map, and some other cleanup. 2020-03-31 09:01:58 -07:00
Adam Ierymenko b3314cd34f Small build fixes. 2020-03-30 18:09:11 -07:00
Adam Ierymenko 9428fc53f6 A bunch of cleanup, bug fix, just use unordered_map, etc. 2020-03-30 17:28:23 -07:00
Adam Ierymenko 0d05e4bcae Remove capability chain of custody stuff which was never used and was really overly complex and a potential source of security problems. 2020-03-28 12:06:10 -07:00
Adam Ierymenko 87da45b3f5 Faster hash table, various other optimizations and simplification. 2020-03-28 01:06:29 -07:00
Adam Ierymenko cbf174f96d Warning removal. 2020-03-27 19:35:37 -07:00
Adam Ierymenko 0aa78d0ecb Small fixes. 2020-03-27 19:03:09 -07:00
Adam Ierymenko a87d4f1864 Build fix. 2020-03-27 17:26:49 -07:00
Adam Ierymenko c0e86de6db Forgot one spot. 2020-03-27 17:25:05 -07:00
Adam Ierymenko 60fa07bff2 Implement fingerprint option on join in Go land 2020-03-27 17:02:44 -07:00
Adam Ierymenko 1df7f21f5f Add ability to fully specify controller fingerprint on join for the paranoid. 2020-03-27 16:36:38 -07:00
Adam Ierymenko 674edab814 docs 2020-03-27 15:09:09 -07:00
Adam Ierymenko 369df245e3 Some perf stuff, docs, HELLO design tweaks for ephemeral keys. 2020-03-27 13:09:37 -07:00
Adam Ierymenko 1f2e94a51d Some optimization and raw memory access cleanup. 2020-03-27 07:40:14 -07:00
Adam Ierymenko 3f32cffc40 dead code removal 2020-03-26 15:56:26 -07:00
Adam Ierymenko 3914964a35 AES docs 2020-03-26 15:55:31 -07:00
Adam Ierymenko bedf63e257 Some minor security tightening stuff and AES fixes. 2020-03-26 13:54:15 -07:00
Adam Ierymenko d151d731a6 (1) Mask bit 31 of AES-CTR nonce to disallow uint32 overflow, (2) get rid of handling of uint32/uint64 overflow in our AES-CTR code to optimize, (3) optimize AES software a bit 2020-03-26 10:28:59 -07:00
Adam Ierymenko 2d862f1d32 Little comments and stuff 2020-03-26 08:38:23 -07:00
Adam Ierymenko f92fca03a0 Update SIV diagram, length pad AAD. 2020-03-25 15:09:49 -07:00
Adam Ierymenko b5c01999b8 More tweaks to COM stuff. 2020-03-25 14:10:26 -07:00
Adam Ierymenko e9da35bac3 Harden some stuff around COMs and members of networks. 2020-03-25 13:21:50 -07:00
Adam Ierymenko d3a7468e83 Implement AES-GMAC-SIV and benchmark, rework COM and add a lot of comments and docs, and comments and docs elsewhere too. 2020-03-25 09:05:44 -07:00
Adam Ierymenko f3540a5c7c Linux build fixes, warning removal. 2020-03-24 08:39:54 -07:00
Adam Ierymenko 8cf6808c50 build fix 2020-03-23 16:24:39 -07:00
Adam Ierymenko 274db26339 Fix accidentally removed file. 2020-03-23 16:15:36 -07:00
Adam Ierymenko 490b9c4d79 Moar build fixes, clock perf improvement. 2020-03-23 16:12:45 -07:00
Adam Ierymenko 2da096944d Everything but root builds now. Back to testing. 2020-03-18 07:20:04 -07:00
Adam Ierymenko 83f830618f It almost builds! 2020-03-17 16:27:31 -07:00
Adam Ierymenko cdbb86b830 ARM64 stuff 2020-03-16 09:57:51 -07:00
Adam Ierymenko 483b47474d ARM64 stuff 2020-03-16 09:51:18 -07:00
Adam Ierymenko 1d314858ef ARM64 build fixes 2020-03-16 09:27:56 -07:00
Adam Ierymenko 37d4e83fad ARM64 build fixes 2020-03-16 09:24:57 -07:00
Adam Ierymenko c7f3f3add9 Small fix, docs, warning removal. 2020-03-16 06:14:41 -07:00
Adam Ierymenko 1c7baa544b Reduce PoW cost just a bit. 2020-03-15 20:14:35 -07:00
Adam Ierymenko 3408839b33 build fix 2020-03-15 20:07:21 -07:00
Adam Ierymenko a7409486bb minor stuff 2020-03-15 19:44:40 -07:00
Adam Ierymenko cf24ed4108 This PoW seems decent 2020-03-15 14:08:53 -07:00
Adam Ierymenko 8a379ba0a1 The MIMC thing was neat but unfortunately is amenable to too much GPU acceleration. 2020-03-14 20:29:44 -07:00
Adam Ierymenko 4b20638568 more test fixes 2020-03-14 15:27:01 -07:00
Adam Ierymenko eebe2046f0 docs 2020-03-14 12:17:30 -07:00
Adam Ierymenko 1e457dbd76 Fix tests, fix identity issue 2020-03-14 12:08:40 -07:00
Adam Ierymenko a20aebaaf8 Some work on delay function... which is delaying us... but need to get it right because its hard as hell to change later. 2020-03-09 15:19:58 -07:00
Adam Ierymenko 5463c70aaf Minor stuff, and some docs 2020-03-06 12:18:20 -08:00
Adam Ierymenko 24e30a684b A bunch of little nit-picky header and name cleanup. 2020-03-04 08:16:44 -08:00
Adam Ierymenko 05e52493a4 Go module update 2020-03-03 07:41:15 -08:00
Adam Ierymenko d8f1e01b77 cleanup 2020-03-03 07:40:19 -08:00
Adam Ierymenko da5b11bf2d Rename version constants to something more canonical, and more cleanup. 2020-03-03 07:38:51 -08:00
Adam Ierymenko b824ea7bcf Add buffer life cycle stuff to API for fewer memcpys. 2020-03-02 17:15:00 -08:00
Adam Ierymenko b96ea5ae03 Fingerprint string conversion, API stuff 2020-03-02 15:13:34 -08:00
Adam Ierymenko fbd3e10488 cleanup 2020-03-02 14:41:15 -08:00
Adam Ierymenko 51f0882849 comments 2020-03-02 14:39:42 -08:00
Adam Ierymenko 416068f68e Regularize use of fingerprint concept across code. 2020-03-02 12:09:38 -08:00
Adam Ierymenko a8db4a8d2d Minor future proofing and cleanup in CertificateOfMembership, improve comments in a few places. 2020-03-02 10:25:15 -08:00
Adam Ierymenko 6b49148d4e More cross-platform build fixes and add tests for hton/ntoh/other byte order stuff because breakage there would be annoying. 2020-02-28 11:27:30 -08:00
Adam Ierymenko 77e59818a3 dead code removal 2020-02-27 15:59:39 -08:00
Adam Ierymenko 6262374205 Add tests for identity marshal/unmarshal and fix an issue found. 2020-02-27 15:40:31 -08:00
Adam Ierymenko ed8271530f cleanup 2020-02-27 14:54:15 -08:00
Adam Ierymenko 8e4d7c56d8 Stub out a protocol field in Endpoint INETADDR types for future use. 2020-02-27 14:24:11 -08:00
Adam Ierymenko 0598315d68 Fix V1 sample ID 2020-02-27 12:59:00 -08:00
Adam Ierymenko 05e5d08959 A little more delay margin 2020-02-27 12:13:12 -08:00
Adam Ierymenko ca33eaf28d FPU trick seems to always be faster 2020-02-27 12:09:26 -08:00
Adam Ierymenko 13e86fdb6c lalala build fixes 2020-02-27 11:57:45 -08:00
Adam Ierymenko ffbd18f4ef build fix 2020-02-27 11:52:32 -08:00
Adam Ierymenko fabb0f734a build fix 2020-02-27 11:47:01 -08:00
Adam Ierymenko 1e59d92df3 warning removal 2020-02-27 11:45:56 -08:00
Adam Ierymenko ecd09946e6 warning removal 2020-02-27 11:45:06 -08:00
Adam Ierymenko 789b8b8454 compile fix 2020-02-27 11:43:54 -08:00
Adam Ierymenko f107a71796 docs, compile fixes. 2020-02-27 11:42:00 -08:00
Adam Ierymenko 066b4c27a4 tweaks 2020-02-27 10:31:55 -08:00
Adam Ierymenko fbfa99fac5 Speed up V1 identity verification a little, and add some comments. 2020-02-27 09:43:58 -08:00
Adam Ierymenko c5bd21a23e various optimization 2020-02-26 17:00:03 -08:00
Adam Ierymenko 1c7e1da4d1 cleanup, docs 2020-02-26 12:40:29 -08:00
Adam Ierymenko 5cec5fe6b1 Make Fingerprint (a full length identity hash) a first class type 2020-02-26 11:39:18 -08:00
Adam Ierymenko ea0961dfd2 docs 2020-02-26 11:32:54 -08:00
Adam Ierymenko f20905b08a Throw some more mulmod52 implementations in there (but currently disabled) for future use so we do not have to hunt them down again. 2020-02-26 11:31:03 -08:00
Adam Ierymenko 83e79e1a1b V1 identities now use a VDF (verifiable delay function) 2020-02-26 11:08:03 -08:00
Adam Ierymenko c6a7b5774c MIMC52 2020-02-26 09:58:28 -08:00
Adam Ierymenko 27ab88db1e little stuff 2020-02-25 16:21:51 -08:00
Adam Ierymenko 1b71b6d01a hash() -> fingerprint() 2020-02-25 16:15:14 -08:00
Adam Ierymenko dcb3d49d35 Cleanup, Address refactoring, tweak V1 identity generation a bit. 2020-02-25 16:08:27 -08:00
Adam Ierymenko 5c14a072d5 rename 2020-02-25 06:03:24 -08:00
Adam Ierymenko 4eb491065b clean out old files 2020-02-25 06:03:04 -08:00
Adam Ierymenko b87e8d8e41 readability++ 2020-02-25 06:00:52 -08:00
Adam Ierymenko a58f11e601 Tweak protocol getPacketId(), unit tests for defragmenter, AES fix. 2020-02-25 05:36:48 -08:00
Adam Ierymenko 547f39bb49 Fixes for Buf, unit test 2020-02-24 15:40:19 -08:00
Adam Ierymenko df99f5e3f3 More crypto benchmarks 2020-02-24 14:44:20 -08:00
Adam Ierymenko 15e88a8b7e MOAR AES V-TEC 2020-02-24 13:53:50 -08:00
Adam Ierymenko 61b72d42b8 More AES tweaks 2020-02-24 13:30:35 -08:00
Adam Ierymenko 56bf504ec2 Small AES tweak 2020-02-24 12:48:56 -08:00
Adam Ierymenko 1f02250dd8 Ridiculously fast AES-CTR 2020-02-24 11:56:37 -08:00
Adam Ierymenko 5d0c6db19c Crypto fixes and benchmarks. 2020-02-21 19:32:36 -08:00
Adam Ierymenko 4af3467757 AES-CTR test vectors and fixes to CTR code. 2020-02-21 17:22:26 -08:00
Adam Ierymenko 87890565f3 It builds, and basic stuff and crypto passes tests. 2020-02-21 16:43:12 -08:00
Adam Ierymenko d603a73715 Build fixes. 2020-02-21 15:58:28 -08:00
Adam Ierymenko 55b0555aa0 A bunch more build fixes. 2020-02-21 14:46:01 -08:00
Adam Ierymenko 1a2378a3d4 More crypto unit tests. 2020-02-21 12:20:57 -08:00
Adam Ierymenko c6ce6b46ce build fixes 2020-02-21 08:44:53 -08:00
Adam Ierymenko f109f2e612 Identity v1 hash tweak 2020-02-21 08:10:43 -08:00
Adam Ierymenko 8f8e3f4960 OS/platform include cleanup 2020-02-21 08:01:58 -08:00
Adam Ierymenko 1d885cf810 Build fixes, put uint128_t detection in one place. 2020-02-21 07:25:43 -08:00
Adam Ierymenko 5275a34b0b more refactoring 2020-02-21 07:11:16 -08:00
Adam Ierymenko c3b5c45fea Fix InetAddress sizing by delving into crazy C++ weeds, fix Peer compile issues. 2020-02-20 13:55:09 -08:00
Adam Ierymenko 565a686be7 include cleanup 2020-02-20 13:25:56 -08:00
Adam Ierymenko 12cfb6501d Cleanup in ECC384 including const-correctness, etc. 2020-02-20 13:11:51 -08:00
Adam Ierymenko de1b54821e Starting to (re)write unit tests. 2020-02-20 12:54:46 -08:00
Adam Ierymenko 320c8429c2 Yet more perf, security hardening, and compile fix tweaks. 2020-02-20 09:33:11 -08:00
Adam Ierymenko a4e24c8390 Build fixes 2020-02-19 11:32:16 -08:00
Adam Ierymenko 0589964f99 Yet more cleanup, and add meters to paths. 2020-02-19 11:06:05 -08:00
Adam Ierymenko 1affb6814c A little more cleanup and build fixes. 2020-02-19 10:32:02 -08:00
Adam Ierymenko b70ab0d354 Include file cleanup, docs, and build fixes. 2020-02-19 10:18:52 -08:00
Adam Ierymenko 4a9266feef Comment out not-yet-refactored code in Network 2020-02-19 09:42:11 -08:00
Adam Ierymenko 1e0a930d23 Create a container for identity hashes, replace some "volatile" hacky junk with std::atomic, clean up some security checks, rename raw data in Buf to unsafeData to permit search for unsafe. 2020-02-19 09:28:18 -08:00
Adam Ierymenko 46d3780e89 AES stuff, port sending network credentials to new packet format. 2020-02-18 17:17:10 -08:00
Adam Ierymenko 311c98e24e Various other small things. 2020-02-18 14:20:49 -08:00
Adam Ierymenko 9ad8dd3700 Add Peer method for getting preferred cipher, various cleanup in VL1 2020-02-18 12:38:48 -08:00
Adam Ierymenko 0dc476518b Documentation changes, and move HMAC auth on HELLO to before object decoding since this is good cryptographic practice. 2020-02-18 10:31:31 -08:00
Adam Ierymenko 8c8a3c58ec Various little things... 2020-02-18 06:33:31 -08:00
Adam Ierymenko a0ac4a744e Change the type 1 identity a bit to make locallyValidate() super fast, eliminating a scaling issue with v0. 2020-02-17 15:09:26 -08:00
Adam Ierymenko 3448e6fc76 Yet MORE refactoring, including moving expected-reply-to out of Node and into its own class for cleanliness. 2020-02-14 14:12:42 -08:00
Adam Ierymenko e5c7366e71 Yet more minor refactoring and redesign Meter to be more thread-safe. 2020-02-14 11:34:47 -08:00
Adam Ierymenko e236d6f743 More minor refactoring 2020-02-14 10:19:45 -08:00
Adam Ierymenko 5db0d9438c More built-in AES and GMAC primitive work. 2020-02-14 09:05:48 -08:00
Adam Ierymenko 08e06f9b8f More refactoring and a bunch of AES goodness. 2020-02-13 14:44:18 -08:00
Adam Ierymenko 018fe04163 More nit-picky refactoring. 2020-02-12 14:14:31 -08:00
Adam Ierymenko f21ecb3762 Yet more major and very nit-picky refactoring for performance, etc. Also use std::atomic<> now with a TODO to implement a shim if we ever do need to build this on a pre-c++11 compiler. 2020-02-12 14:04:25 -08:00
Adam Ierymenko 60de5ed3dd It almost compiles again 2020-02-07 13:54:17 -08:00
Adam Ierymenko df4b1e9b12 Yet more work on VL1/VL2 2020-02-07 00:02:29 -08:00
Adam Ierymenko c3d3605f70 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-02-06 18:07:22 -08:00
Adam Ierymenko a9003d16f2 Put Switch in attic too 2020-02-06 18:07:17 -08:00
Adam Ierymenko 84619a7788 A bunch more refactoring including splitting Switch into VL1 and VL2 2020-02-06 18:06:50 -08:00
Grant Limberg db127887b6 libssl-dev on trusty images 2020-02-05 10:57:29 -08:00
Grant Limberg e0588b89b2 libssl-dev 2020-02-04 12:48:58 -08:00
Grant Limberg 7d2eceef01 no building cmake on wheezy either 2020-02-04 12:36:39 -08:00
Grant Limberg e5e444c7ae can't even build cmake on Centos 6. Will need another method for packaging 2020-02-04 12:08:47 -08:00
Grant Limberg 4b083b8c41 more dependencies 2020-02-04 12:06:26 -08:00
Grant Limberg 245d92b40c add openssl-devel to centos images 2020-02-04 11:46:09 -08:00
Grant Limberg 931ad1aca8 Add CMake to all the docker images 2020-02-04 11:38:42 -08:00
Grant Limberg 5e488d3aa0 fix PATH 2020-02-04 10:33:18 -08:00
Grant Limberg cc52835ce3 remove unneeded output 2020-02-04 09:39:13 -08:00
Adam Ierymenko 7d11522768 Just about everything refactored for new Protocol/Buf code except Switch. 2020-02-03 16:18:33 -08:00
Grant Limberg 417cdc17dc Skip generating packages on edge as that's not reimplemented in CMake yet 2020-02-03 14:00:46 -08:00
Grant Limberg c537955c65 ensure go is in the PATH for jenkins builds 2020-02-03 13:57:03 -08:00
Grant Limberg a0efea8e0f Merge branch 'dev' into edge
# Conflicts:
#	.gitignore
#	Jenkinsfile
#	attic/macui/ZeroTier One.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
#	attic/service/OneService.cpp
2020-02-03 13:54:49 -08:00
Grant Limberg cce51cea5d Merge branch 'pipeline' into dev 2020-02-03 13:48:46 -08:00
Adam Ierymenko df346a6df6 Work in progress... clean up memcpy and create an annotation for that, lots more porting to new Buf/Protocol code, etc. 2020-02-03 13:00:13 -08:00
Grant Limberg ba4324f992 Update jenkinsfile for new build process 2020-02-03 12:51:46 -08:00
Grant Limberg 81e982991b add kali rolling 2020-02-03 10:46:39 -08:00
Grant Limberg f6f4fba90e Add docker configs for multi arch jenkins builds 2020-02-03 09:57:48 -08:00
root 23d5a972ba disable lintian because sid/bullseye are sitting there running /bin/sleep 3 endlessly on this step 2020-01-31 13:15:23 -08:00
Adam Ierymenko cdc6c42375 Take Dictionary behind the barn... 2020-01-25 18:02:11 -08:00
Adam Ierymenko d5b9a54c55 Continuing work on new buffer type... 2020-01-25 01:17:56 -08:00
Adam Ierymenko 59da359b06 More porting to new Buf system. 2020-01-24 23:36:08 -08:00
Adam Ierymenko 91ce4c4ea6 Refactoring protocol marshal/unmarshal code... 2020-01-24 21:16:07 -08:00
Adam Ierymenko e9656ecf11 More wiring up of addroot/removeroot etc. 2020-01-24 13:27:01 -08:00
Adam Ierymenko 5c6bf9d0a4 Wiring up addroot/removeroot 2020-01-23 18:05:34 -08:00
Adam Ierymenko 0de194dab3 It builds again 2020-01-23 14:41:59 -08:00
Adam Ierymenko 33bb61c63d Loads of refactoring, integration of new version of Trace. 2020-01-23 13:05:33 -08:00
Grant Limberg 5faf0f8ab6 whoops 2020-01-23 09:46:15 -08:00
Grant Limberg 0f17cd4791 Update to jenkinsfile for multi-platform release builds 2020-01-23 09:41:17 -08:00
Grant Limberg e0518ab176 testing armv5t instead of armv5 flag 2020-01-22 16:36:26 -08:00
Adam Ierymenko e6273b3300 cleanup 2020-01-21 13:12:07 -08:00
Adam Ierymenko d7b31fe014 Warning removal and build fixes. 2020-01-21 12:55:51 -08:00
Adam Ierymenko 5aae5f95bf Merge commit 'bba132414527f1742dd1ca550dad5ecce94dfa40' into edge 2020-01-21 11:05:12 -08:00
Adam Ierymenko 182561f7e6 Port checking fixes. 2020-01-21 11:00:06 -08:00
Adam Ierymenko 41871c8b1e Merge commit 'ff655292fba09c0a0d1ed4b4dda738c165ad4404' into edge 2020-01-21 10:59:44 -08:00
Adam Ierymenko 782b75a64e Linux build fixes 2020-01-20 21:27:51 -08:00
Adam Ierymenko 0c58901469 cleanup 2020-01-20 21:05:29 -08:00
Adam Ierymenko 73b23f1b16 Go code cleanup and fixes, other cleanup. 2020-01-20 16:03:19 -08:00
Adam Ierymenko 5a29f9ba2d cleanup 2020-01-20 11:18:38 -08:00
Adam Ierymenko 03190c5a55 Bunch of build fixes, some docs 2020-01-20 10:40:31 -08:00
Adam Ierymenko dab968ed96 Put LZ4 in its own file. 2020-01-20 09:38:05 -08:00
Adam Ierymenko b598263261 More 2.x notice updates. 2020-01-20 08:49:10 -08:00
Adam Ierymenko eef70e198b Version 2.x notice updates and other boring stuff. 2020-01-20 08:46:20 -08:00
Adam Ierymenko 89c41f88a4 Module version bump, vendor, cleanup 2020-01-20 08:23:30 -08:00
Adam Ierymenko 53b7c8f725 Make Peer bootstrap field an Endpoint even though we only support InetAddress right now, and a bunch more stuff. 2020-01-20 08:08:38 -08:00
Adam Ierymenko d471142908 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-01-17 14:01:32 -08:00
Adam Ierymenko 3ff9ffd5d4 A bunch of wiring up of stuff... 2020-01-17 14:01:22 -08:00
Grant Limberg 6e72b6fb37 Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-01-15 16:12:51 -08:00
Grant Limberg 0c9be4de14 add /metrics endpoint for exposing root metrics to Prometheus 2020-01-15 16:12:34 -08:00
Adam Ierymenko b53b7f4950 . 2020-01-14 15:34:06 -08:00
Adam Ierymenko b2f0b35608 Move self-test so it can be called from CLI and always builds, implement Endpoint and Locator deserialization in Go as well as C++. 2020-01-14 14:37:49 -08:00
Adam Ierymenko cba7a5d4d7 Self test is back, wiring up roots again. 2020-01-13 16:35:49 -08:00
Grant Limberg 8e1a88c2fb Merge branch 'edge' of http://git.int.zerotier.com/zerotier/ZeroTierOne into edge 2020-01-13 15:32:31 -08:00
Adam Ierymenko ee5a988f14 Wiring back up PUSH_DIRECT_PATHS and friends. 2020-01-13 14:04:17 -08:00
Adam Ierymenko f814a07ab3 Go build works now 2020-01-10 22:12:56 -08:00
Adam Ierymenko a5aea2f3bb Everything but the Go code builds now! 2020-01-10 21:09:13 -08:00
Adam Ierymenko 7291ac2093 A bunch more cleanup and build fixes, and remove old version of multipath code to prep for new version. 2020-01-10 20:40:14 -08:00
Adam Ierymenko 790fe50fac Go code cleanup for new changes 2020-01-10 16:54:01 -08:00
Adam Ierymenko 83eacdfada New Buffer implementation (not used yet) and cleanup 2020-01-10 15:28:27 -08:00
Adam Ierymenko 2fbeaaf148 Bunch more fixes, implement C API for Identity operations. 2020-01-09 13:50:51 -08:00
Adam Ierymenko 57710cbc38 . 2020-01-09 08:39:47 -08:00
Adam Ierymenko 8bae0acaf9 More cleanup and build fixes, almost builds again! 2020-01-08 21:48:01 -08:00
Adam Ierymenko ef64e6a336 Build fixes, cleanup 2020-01-08 21:24:47 -08:00
Adam Ierymenko 9642ff5fb9 . 2020-01-08 18:08:41 -08:00
Adam Ierymenko 263798d1c3 cleanup 2020-01-07 14:04:08 -08:00
Adam Ierymenko 3fbfad5585 cleanup 2020-01-07 14:03:50 -08:00
Adam Ierymenko 627533cf48 . 2020-01-07 13:24:15 -08:00
Adam Ierymenko 19899de5a6 . 2020-01-06 18:14:35 -08:00
Adam Ierymenko c1b2c7903c . 2020-01-02 19:04:36 -05:00
Grant Limberg 28df0c2e38 Merge branch 'dev' of github.com:zerotier/ZeroTierOne into dev 2019-12-17 10:56:53 -08:00
Grant Limberg 7696d45093 Fix handling of invalid conf file
Fixes GitHub issue #1068
2019-12-17 10:51:01 -08:00
Grant Limberg 2a7d4fcde5 update vs project settings 2019-12-17 10:49:21 -08:00
Adam Ierymenko 3b94ef99ae Bunch of new-gen serialization work 2019-12-16 11:57:33 -08:00
Adam Ierymenko 6267c67888 A bunch of cleanup and refactoring toward 2.x 2019-12-12 16:15:49 -08:00
Adam Ierymenko 23d6a3aacd Moar refactoring 2019-12-11 13:46:44 -08:00
Adam Ierymenko 72361fb1c8 Cleanup and refactor 2019-12-11 13:27:11 -08:00
Adam Ierymenko b55f98b813 wip 2019-12-11 12:04:22 -08:00
Grant Limberg 995fa4a76c Merge branch 'refs/heads/master' into dev 2019-11-22 15:00:39 -08:00
Grant Limberg d8597884f6 jenkins windows 2019-11-22 11:25:31 -08:00
Grant Limberg a993ddc54d Merge branch 'refs/heads/master' into dev 2019-11-21 15:12:37 -08:00
Grant Limberg 54e25084fe re-enable CI on master 2019-11-21 14:51:33 -08:00
Grant Limberg e58a0b3efb build central controller docker images on macOS 2019-11-21 14:49:24 -08:00
Grant Limberg 381f15382c Convert central-controller docker build to use a builder subcontainer 2019-11-20 13:56:26 -08:00
Adam Ierymenko 5a4d681af8 Build fixes. 2019-11-19 16:45:53 -08:00
Adam Ierymenko a16a0a8ce5 Warning removal. 2019-11-19 16:22:11 -08:00
Grant Limberg 91d679af15 Merge pull request #1087 from skunkwerks/dev
drop -Werror from DEBUG builds
2019-11-19 08:47:38 -08:00
Dave Cottlehuber 8396f16dd2 drop -Werror from DEBUG builds
Appease compilers. Thanks @glimberg for the diff.
Closes #1086
2019-11-19 16:45:06 +00:00
Grant Limberg 203df51752 ignore workspace/ folder
It's where I usually put temporary identity, etc. files for testing
2019-11-13 12:48:32 -08:00
Grant Limberg dc19deb6c3 . 2019-11-13 12:46:52 -08:00
Grant Limberg 86abd31659 fix log line 2019-11-13 12:46:16 -08:00
Joseph Henry b8e70d866a Compile fix for unterminated conditional directive 2019-11-12 09:46:39 -08:00
Joseph Henry e1e27eb19d Bugfix for incorrect port binding of secondary and tertiary ports 2019-11-11 12:03:49 -08:00
Adam Ierymenko 47b4efd49b Work in progress... 2019-11-04 14:24:37 -08:00
Grant Limberg 088dab4f04 Let's not print this to the logs 2019-10-31 15:13:20 -07:00
Grant Limberg cc79ec6179 use std::string instead of const char* in rmq struct 2019-10-31 15:08:59 -07:00
Grant Limberg 74478b24b0 add librabbitmq binaries for macos for testing central controller 2019-10-31 14:04:25 -07:00
Adam Ierymenko 14fab11081 Merge dev, clean up old files 2019-10-16 06:05:29 -07:00
Adam Ierymenko 4c55f3eaa5 Work in progress 2019-10-16 06:03:32 -07:00
Travis LaDuke bad95d7c67 Update cli help to say <network ID> instead of <network>
Closes #1054
2019-10-15 13:15:45 -07:00
Adam Ierymenko 891bf99894 work in progress 2019-10-15 12:49:03 -07:00
Adam Ierymenko 22e95b3bcb . 2019-10-09 10:00:30 -07:00
Adam Ierymenko 4da315fab2 Plumb through external interface stuff 2019-10-03 10:43:28 -07:00
Adam Ierymenko 507ba7d26a Go build stuff, root stuff 2019-10-02 17:55:15 -07:00
864 changed files with 90895 additions and 77827 deletions

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
.git/
build/
!build/zerotier
Executable → Regular
+10 -64
View File
@@ -1,30 +1,23 @@
build/
/version.h
/build
/cmake-build-debug
/cmake-build-release
/core/version.h
/.idea
/.ide-*
.DS_Store
.Trashes
*.swp
._*
*~
*~.nib
*.secret
.Apple*
Thumbs.db
@eaDir
DerivedData/
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3
*.xccheckout
xcuserdata/
.vscode
__pycache__
attic/world/*.c25519
attic/world/mkworld
*.log
*.bak
*.opensdf
*.user
*.cache
@@ -41,53 +34,6 @@ attic/world/mkworld
*.tmp
.depend
node_modules
debian/files
debian/zerotier-one
debian/zerotier-one*.debhelper
debian/*.log
debian/zerotier-one.substvars
root/identity.*
root/config.*
/ext/installfiles/windows/chocolatey/zerotier-one/*.nupkg
/go/zerotier
/windows/ZeroTierOne.sdf
/windows/ZeroTierOne.v11.suo
/windows/x64
/windows/Win32
/windows/*/x64
/windows/*/Win32
/windows/ZeroTierOne/Release
/windows/ZeroTierOneService/obj
/windows/ZeroTierOneService/bin
/windows/Build
/windows/Debug
/windows/Release
/windows/WebUIWrapper/bin
/windows/WebUIWrapper/obj
/windows/lib
/ext/installfiles/windows/ZeroTier One-SetupFiles
/ext/installfiles/windows/Prerequisites
/ext/installfiles/windows/*-cache
/*.msi
/windows/.vs
*.vcxproj.backup
/windows/TapDriver6/Win7Debug
/windows/TapDriver6/win7Release
/windows/*.db
/windows/*.opendb
enc_temp_folder
/windows/copyutil/bin
/windows/copyutil/obj
java/obj/
java/libs/
java/bin/
java/classes/
java/doc/
java/build_win64/
java/build_win32/
/java/mac32_64/
windows/WinUI/obj/
windows/WinUI/bin/
windows/ZeroTierOne/Debug/
/*.db
/*.opendb
-3
View File
@@ -1,3 +0,0 @@
# Default ignored files
/workspace.xml
-9
View File
@@ -1,9 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="Go" enabled="true" />
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
-5
View File
@@ -1,5 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>
-11
View File
@@ -1,11 +0,0 @@
<component name="ProjectDictionaryState">
<dictionary name="api">
<words>
<w>apisocket</w>
<w>nwid</w>
<w>secrand</w>
<w>sockaddr</w>
<w>unmarshals</w>
</words>
</dictionary>
</component>
-10
View File
@@ -1,10 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
<option name="processCode" value="true" />
<option name="processLiterals" value="true" />
<option name="processComments" value="true" />
</inspection_tool>
</profile>
</component>
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>
-8
View File
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/ZeroTierOne.iml" filepath="$PROJECT_DIR$/.idea/ZeroTierOne.iml" />
</modules>
</component>
</project>
Generated
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
-29
View File
@@ -1,29 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectTasksOptions">
<TaskOptions isEnabled="true">
<option name="arguments" value="fmt $FilePath$" />
<option name="checkSyntaxErrors" value="true" />
<option name="description" />
<option name="exitCodeBehavior" value="ERROR" />
<option name="fileExtension" value="go" />
<option name="immediateSync" value="false" />
<option name="name" value="go fmt" />
<option name="output" value="$FilePath$" />
<option name="outputFilters">
<array />
</option>
<option name="outputFromStdout" value="false" />
<option name="program" value="$GoExecPath$" />
<option name="runOnExternalChanges" value="false" />
<option name="scopeName" value="Project Files" />
<option name="trackOnlyRoot" value="true" />
<option name="workingDir" value="$ProjectFileDir$" />
<envs>
<env name="GOROOT" value="$GOROOT$" />
<env name="GOPATH" value="$GOPATH$" />
<env name="PATH" value="$GoBinDirs$" />
</envs>
</TaskOptions>
</component>
</project>
+7 -9
View File
@@ -9,7 +9,7 @@
* Java JNI Interface to enable Android application development, and Android app itself (code for that is elsewhere)<br>
Grant Limberg / glimberg@gmail.com
* ZeroTier SDK (formerly known as Network Containers)<br>
* ZeroTier SDK / libzt<br>
Joseph Henry / joseph.henry@zerotier.com
## Third Party Contributors
@@ -32,32 +32,30 @@ ZeroTier includes the following third party code, either in ext/ or incorporated
* LZ4 compression algorithm by Yann Collet
* Files: node/Packet.cpp (bundled within anonymous namespace)
* Files: node/LZ4.cpp
* Home page: http://code.google.com/p/lz4/
* License grant: BSD 2-clause
* License: BSD 2-clause
* C++11 json (nlohmann/json) by Niels Lohmann
* Files: ext/json/*
* Home page: https://github.com/nlohmann/json
* License grant: MIT
* License: MIT
* tap-windows6 by the OpenVPN project
* Files: windows/TapDriver6/*
* Home page: https://github.com/OpenVPN/tap-windows6/
* License grant: GNU GPL v2
* ZeroTier Modifications: change name of driver to ZeroTier, add ioctl() to get L2 multicast memberships (source is in ext/ and modifications inherit GPL)
* License: GNU GPL v2
* Salsa20 stream cipher, Curve25519 elliptic curve cipher, Ed25519 digital signature algorithm, and Poly1305 MAC algorithm, all by Daniel J. Bernstein
* Files: node/Salsa20.* node/C25519.* node/Poly1305.*
* Home page: http://cr.yp.to/
* License grant: public domain
* ZeroTier Modifications: slight cryptographically-irrelevant modifications for inclusion into ZeroTier core
* License: public domain
* cpp-httplib by yhirose
* Files: ext/cpp-httplib/*
* Home page: https://github.com/yhirose/cpp-httplib
* License grant: MIT
* License: MIT
+316 -170
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1,5 +1,5 @@
ZeroTier One, an endpoint server for the ZeroTier virtual network layer.
Copyright © 2011–2019 ZeroTier, Inc.
Copyright © 2013–2020 ZeroTier, Inc.
ZeroTier is released under the terms of the BSL version 1.1. See the
file LICENSE.txt for details.
Vendored
+494 -82
View File
File diff suppressed because it is too large. Load diff
+4 -4
View File
@@ -10,8 +10,8 @@ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
Parameters
Licensor: ZeroTier, Inc.
Licensed Work: ZeroTier Network Virtualization Engine 1.4.4
The Licensed Work is (c)2019 ZeroTier, Inc.
Licensed Work: ZeroTier Network Virtualization Engine
The Licensed Work is (c)2013-2020 ZeroTier, Inc.
Additional Use Grant: You may make use of the Licensed Work, provided you
do not use it in any of the following ways:
@@ -26,7 +26,7 @@ Additional Use Grant: You may make use of the Licensed Work, provided you
ZeroTier behind the scenes to operate a service not
related to ZeroTier network administration.
* Create Non-Open-Source Commercial Derviative Works
* Create Non-Open-Source Commercial Derivative Works
(2) Link or directly include the Licensed Work in a
commercial or for-profit application or other product
@@ -47,7 +47,7 @@ Additional Use Grant: You may make use of the Licensed Work, provided you
services, social welfare, senior care, child care, and
the care of persons with disabilities.
Change Date: 2023-01-01
Change Date: 2025-01-01
Change License: Apache License version 2.0 as published by the Apache
Software Foundation
+16 -5
View File
@@ -1,17 +1,28 @@
# Common makefile -- loads make rules for each platform
BUILDDIR := build
TIMESTAMP=$(shell date +"%Y%m%d%H%M")
.PHONY: all
all: setup
cd ${BUILDDIR} && $(MAKE) -j$(shell getconf _NPROCESSORS_ONLN)
cd ${BUILDDIR} && $(MAKE) -j4 VERBOSE=1
setup:
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Release
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Release ${CMAKE_ARGS}
setup-debug:
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug ${CMAKE_ARGS}
debug:
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug && $(MAKE)
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug ${CMAKE_ARGS} && $(MAKE)
central-controller:
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_CENTRAL_CONTROLLER=1 ${CMAKE_ARGS} && $(MAKE) -j4
central-controller-debug:
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_CENTRAL_CONTROLLER=1 ${CMAKE_ARGS} && $(MAKE) -j4
central-controller-docker:
docker build -t registry.zerotier.com/zerotier-central/ztcentral-controller:${TIMESTAMP} -f controller/central-docker/Dockerfile .
clean:
rm -rf ${BUILDDIR}
+37
View File
@@ -1,6 +1,43 @@
ZeroTier Release Notes
======
# Version 1.9.0 (2.0 beta)
Version 2.0 is a very significant release with many changes. It remains backward compatibility to version 1.4.0 (and possibly earlier versions but this is not guaranteed) but makes numerous local and behavioral changes that should be reviewed before upgrading production systems.
After this release we're going to be working to get to a more frequent, less extreme, more "agile" release cadence.
Protocol changes:
* Trusted paths have been completely removed. The new AES mode is so fast on CPUs with AES acceleration that much of the rationale for this is gone, and this feature was never used much to begin with due to inconvenience and obvious security concerns. Environments using trusted paths will need to upgrade all nodes at once.
* The symmetric encryption algorithm and mode is now AES-GMAC-SIV, a variation of AES-GCM using the same primitives but offering superior security bounds and behavior under non-ideal conditions. It's also a lot faster than Salsa20/12 and Poly1305 on CPUs with AES acceleration (almost all desktops, laptops, and newer routers and phones). Salsa20/12 with Poly1305 is still supported for communication with older versions and small devices that lack AES acceleration.
* A new identity type (1) has been introduced that contains both Curve25519 and NIST P-384 public key types, but classic type 0 remains the default for new identities for now. ECDH key agreement between V1 identities uses both keys and hashes the resulting secrets to yield security equal to the best of the two, but V1 identities can also agree with V0 identities using only their Curve25519 component.
* Roots can now be joined and left like networks in a much more convenient way, and the old "moon" and "planet" terminology is deprecated.
* A new peer to peer multicast algorithm has been introduced that offers much better scalability and better performance, especially when the physical network itself is hub-and-spoke with many low latency peers connected by higher latency WAN links.
* Forward secrecy is finally supported via periodic re-keying using ephemeral asymmetric keys. Both Curve25519 and NIST P-384 keys are used with secrets being hashed to provide security equal to the stronger of the two curves.
* As part of forward secrecy implementation peers now always exchange HELLO messages even if they don't have a direct path.
* Compression is only enabled for control packets as almost all data packets are largely un-compressable.
* New NAT traversal tricks have been added, such as (ab)use of port 500.
Code changes:
* Migrated from GNU make to cmake for easier cross platform builds and simplified build files.
* The core network hypervisor has been significantly refactored, almost amounting to a partial rewrite.
* Critical packet handling paths have been streamlined with unnecessary memcpy() steps removed.
* Host service code has been completely rewritten in Go. Packet handling code remains in C++, but Go offers superior developer productivity when it comes to implementing more complex local service and local API features. Go imposes a little bit more memory overhead but not much and has been tuned to minimize memory use.
User interface:
* Command line interface has been redesigned and rewritten. Old commands names are supported but their output will be different.
Other things:
* The V2 design, protocol, and cryptographic primitives (AES-GMAC-SIV) have been security audited by [Trail of Bits](https://www.trailofbits.com), and the code is being audited as well prior to full 2.0 release.
---
# Older version release notes
# 2019-08-30 -- Version 1.4.6
* Update default root list to latest
-461
View File
@@ -1,461 +0,0 @@
/*
* Copyright (c)2019 ZeroTier, Inc.
*
* Use of this software is governed by the Business Source License included
* in the LICENSE.TXT file in the project's root directory.
*
* Change Date: 2023-01-01
*
* On the date above, in accordance with the Business Source License, use
* of this software will be governed by version 2.0 of the Apache License.
*/
/****/
#ifndef ZT_BINDER_HPP
#define ZT_BINDER_HPP
#include "../node/Constants.hpp"
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef __WINDOWS__
#include <WinSock2.h>
#include <Windows.h>
#include <ShlObj.h>
#include <netioapi.h>
#include <iphlpapi.h>
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <unistd.h>
#include <ifaddrs.h>
#ifdef __LINUX__
#include <sys/ioctl.h>
#include <net/if.h>
#endif
#endif
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <set>
#include <atomic>
#include "../node/InetAddress.hpp"
#include "../node/Mutex.hpp"
#include "../node/Utils.hpp"
#include "Phy.hpp"
#include "OSUtils.hpp"
#if (defined(__amd64) || defined(__amd64__) || defined(__x86_64) || defined(__x86_64__) || defined(__AMD64) || defined(__AMD64__))
#define ZT_UDP_DESIRED_BUF_SIZE 1048576
#else
#define ZT_UDP_DESIRED_BUF_SIZE 131072
#endif
// Period between refreshes of bindings
#define ZT_BINDER_REFRESH_PERIOD 30000
// Max number of bindings
#define ZT_BINDER_MAX_BINDINGS 256
namespace ZeroTier {
/**
* Enumerates local devices and binds to all potential ZeroTier path endpoints
*
* This replaces binding to wildcard (0.0.0.0 and ::0) with explicit binding
* as part of the path to default gateway support. Under the hood it uses
* different queries on different OSes to enumerate devices, and also exposes
* device enumeration and endpoint IP data for use elsewhere.
*
* On OSes that do not support local port enumeration or where this is not
* meaningful, this degrades to binding to wildcard.
*/
class Binder
{
private:
struct _Binding
{
_Binding() : udpSock((PhySocket *)0),tcpListenSock((PhySocket *)0) {}
PhySocket *udpSock;
PhySocket *tcpListenSock;
InetAddress address;
};
public:
Binder() : _bindingCount(0) {}
/**
* Close all bound ports, should be called on shutdown
*
* @param phy Physical interface
*/
template<typename PHY_HANDLER_TYPE>
void closeAll(Phy<PHY_HANDLER_TYPE> &phy)
{
Mutex::Lock _l(_lock);
for(unsigned int b=0,c=_bindingCount;b<c;++b) {
phy.close(_bindings[b].udpSock,false);
phy.close(_bindings[b].tcpListenSock,false);
}
_bindingCount = 0;
}
/**
* Scan local devices and addresses and rebind TCP and UDP
*
* This should be called after wake from sleep, on detected network device
* changes, on startup, or periodically (e.g. every 30-60s).
*
* @param phy Physical interface
* @param ports Ports to bind on all interfaces
* @param portCount Number of ports
* @param explicitBind If present, override interface IP detection and bind to these (if possible)
* @param ifChecker Interface checker function to see if an interface should be used
* @tparam PHY_HANDLER_TYPE Type for Phy<> template
* @tparam INTERFACE_CHECKER Type for class containing shouldBindInterface() method
*/
template<typename PHY_HANDLER_TYPE,typename INTERFACE_CHECKER>
void refresh(Phy<PHY_HANDLER_TYPE> &phy,unsigned int *ports,unsigned int portCount,const std::vector<InetAddress> explicitBind,INTERFACE_CHECKER &ifChecker)
{
std::map<InetAddress,std::string> localIfAddrs;
PhySocket *udps,*tcps;
Mutex::Lock _l(_lock);
bool interfacesEnumerated = true;
if (explicitBind.empty()) {
#ifdef __WINDOWS__
char aabuf[32768];
ULONG aalen = sizeof(aabuf);
if (GetAdaptersAddresses(AF_UNSPEC,GAA_FLAG_SKIP_ANYCAST|GAA_FLAG_SKIP_MULTICAST|GAA_FLAG_SKIP_DNS_SERVER,(void *)0,reinterpret_cast<PIP_ADAPTER_ADDRESSES>(aabuf),&aalen) == NO_ERROR) {
PIP_ADAPTER_ADDRESSES a = reinterpret_cast<PIP_ADAPTER_ADDRESSES>(aabuf);
while (a) {
PIP_ADAPTER_UNICAST_ADDRESS ua = a->FirstUnicastAddress;
while (ua) {
InetAddress ip(ua->Address.lpSockaddr);
if (ifChecker.shouldBindInterface("",ip)) {
switch(ip.ipScope()) {
default: break;
case InetAddress::IP_SCOPE_PSEUDOPRIVATE:
case InetAddress::IP_SCOPE_GLOBAL:
case InetAddress::IP_SCOPE_SHARED:
case InetAddress::IP_SCOPE_PRIVATE:
for(int x=0;x<(int)portCount;++x) {
ip.setPort(ports[x]);
localIfAddrs.insert(std::pair<InetAddress,std::string>(ip,std::string()));
}
break;
}
}
ua = ua->Next;
}
a = a->Next;
}
}
else {
interfacesEnumerated = false;
}
#else // not __WINDOWS__
/* On Linux we use an alternative method if available since getifaddrs()
* gets very slow when there are lots of network namespaces. This won't
* work unless /proc/PID/net/if_inet6 exists and it may not on some
* embedded systems, so revert to getifaddrs() there. */
#ifdef __LINUX__
char fn[256],tmp[256];
std::set<std::string> ifnames;
const unsigned long pid = (unsigned long)getpid();
// Get all device names
OSUtils::ztsnprintf(fn,sizeof(fn),"/proc/%lu/net/dev",pid);
FILE *procf = fopen(fn,"r");
if (procf) {
while (fgets(tmp,sizeof(tmp),procf)) {
tmp[255] = 0;
char *saveptr = (char *)0;
for(char *f=Utils::stok(tmp," \t\r\n:|",&saveptr);(f);f=Utils::stok((char *)0," \t\r\n:|",&saveptr)) {
if ((strcmp(f,"Inter-") != 0)&&(strcmp(f,"face") != 0)&&(f[0] != 0))
ifnames.insert(f);
break; // we only want the first field
}
}
fclose(procf);
}
else {
interfacesEnumerated = false;
}
// Get IPv6 addresses (and any device names we don't already know)
OSUtils::ztsnprintf(fn,sizeof(fn),"/proc/%lu/net/if_inet6",pid);
procf = fopen(fn,"r");
if (procf) {
while (fgets(tmp,sizeof(tmp),procf)) {
tmp[255] = 0;
char *saveptr = (char *)0;
unsigned char ipbits[16];
memset(ipbits,0,sizeof(ipbits));
char *devname = (char *)0;
int n = 0;
for(char *f=Utils::stok(tmp," \t\r\n",&saveptr);(f);f=Utils::stok((char *)0," \t\r\n",&saveptr)) {
switch(n++) {
case 0: // IP in hex
Utils::unhex(f,32,ipbits,16);
break;
case 5: // device name
devname = f;
break;
}
}
if (devname) {
ifnames.insert(devname);
InetAddress ip(ipbits,16,0);
if (ifChecker.shouldBindInterface(devname,ip)) {
switch(ip.ipScope()) {
default: break;
case InetAddress::IP_SCOPE_PSEUDOPRIVATE:
case InetAddress::IP_SCOPE_GLOBAL:
case InetAddress::IP_SCOPE_SHARED:
case InetAddress::IP_SCOPE_PRIVATE:
for(int x=0;x<(int)portCount;++x) {
ip.setPort(ports[x]);
localIfAddrs.insert(std::pair<InetAddress,std::string>(ip,std::string(devname)));
}
break;
}
}
}
}
fclose(procf);
}
// Get IPv4 addresses for each device
if (ifnames.size() > 0) {
const int controlfd = (int)socket(AF_INET,SOCK_DGRAM,0);
struct ifconf configuration;
configuration.ifc_len = 0;
configuration.ifc_buf = nullptr;
if (controlfd < 0) goto ip4_address_error;
if (ioctl(controlfd, SIOCGIFCONF, &configuration) < 0) goto ip4_address_error;
configuration.ifc_buf = (char*)malloc(configuration.ifc_len);
if (ioctl(controlfd, SIOCGIFCONF, &configuration) < 0) goto ip4_address_error;
for (int i=0; i < (int)(configuration.ifc_len / sizeof(ifreq)); i ++) {
struct ifreq& request = configuration.ifc_req[i];
struct sockaddr* addr = &request.ifr_ifru.ifru_addr;
if (addr->sa_family != AF_INET) continue;
std::string ifname = request.ifr_ifrn.ifrn_name;
// name can either be just interface name or interface name followed by ':' and arbitrary label
if (ifname.find(':') != std::string::npos)
ifname = ifname.substr(0, ifname.find(':'));
InetAddress ip(&(((struct sockaddr_in *)addr)->sin_addr),4,0);
if (ifChecker.shouldBindInterface(ifname.c_str(), ip)) {
switch(ip.ipScope()) {
default: break;
case InetAddress::IP_SCOPE_PSEUDOPRIVATE:
case InetAddress::IP_SCOPE_GLOBAL:
case InetAddress::IP_SCOPE_SHARED:
case InetAddress::IP_SCOPE_PRIVATE:
for(int x=0;x<(int)portCount;++x) {
ip.setPort(ports[x]);
localIfAddrs.insert(std::pair<InetAddress,std::string>(ip,ifname));
}
break;
}
}
}
ip4_address_error:
free(configuration.ifc_buf);
if (controlfd > 0) close(controlfd);
}
const bool gotViaProc = (localIfAddrs.size() > 0);
#else
const bool gotViaProc = false;
#endif
#if !defined(ZT_SDK) || !defined(__ANDROID__) // getifaddrs() freeifaddrs() not available on Android
if (!gotViaProc) {
struct ifaddrs *ifatbl = (struct ifaddrs *)0;
struct ifaddrs *ifa;
if ((getifaddrs(&ifatbl) == 0)&&(ifatbl)) {
ifa = ifatbl;
while (ifa) {
if ((ifa->ifa_name)&&(ifa->ifa_addr)) {
InetAddress ip = *(ifa->ifa_addr);
if (ifChecker.shouldBindInterface(ifa->ifa_name,ip)) {
switch(ip.ipScope()) {
default: break;
case InetAddress::IP_SCOPE_PSEUDOPRIVATE:
case InetAddress::IP_SCOPE_GLOBAL:
case InetAddress::IP_SCOPE_SHARED:
case InetAddress::IP_SCOPE_PRIVATE:
for(int x=0;x<(int)portCount;++x) {
ip.setPort(ports[x]);
localIfAddrs.insert(std::pair<InetAddress,std::string>(ip,std::string(ifa->ifa_name)));
}
break;
}
}
}
ifa = ifa->ifa_next;
}
freeifaddrs(ifatbl);
}
else {
interfacesEnumerated = false;
}
}
#endif
#endif
} else {
for(std::vector<InetAddress>::const_iterator i(explicitBind.begin());i!=explicitBind.end();++i)
localIfAddrs.insert(std::pair<InetAddress,std::string>(*i,std::string()));
}
// Default to binding to wildcard if we can't enumerate addresses
if (!interfacesEnumerated && localIfAddrs.empty()) {
for(int x=0;x<(int)portCount;++x) {
localIfAddrs.insert(std::pair<InetAddress,std::string>(InetAddress((uint32_t)0,ports[x]),std::string()));
localIfAddrs.insert(std::pair<InetAddress,std::string>(InetAddress((const void *)"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",16,ports[x]),std::string()));
}
}
const unsigned int oldBindingCount = _bindingCount;
_bindingCount = 0;
// Save bindings that are still valid, close those that are not
for(unsigned int b=0;b<oldBindingCount;++b) {
if (localIfAddrs.find(_bindings[b].address) != localIfAddrs.end()) {
if (_bindingCount != b)
_bindings[(unsigned int)_bindingCount] = _bindings[b];
++_bindingCount;
} else {
PhySocket *const udps = _bindings[b].udpSock;
PhySocket *const tcps = _bindings[b].tcpListenSock;
_bindings[b].udpSock = (PhySocket *)0;
_bindings[b].tcpListenSock = (PhySocket *)0;
phy.close(udps,false);
phy.close(tcps,false);
}
}
// Create new bindings for those not already bound
for(std::map<InetAddress,std::string>::const_iterator ii(localIfAddrs.begin());ii!=localIfAddrs.end();++ii) {
unsigned int bi = 0;
while (bi != _bindingCount) {
if (_bindings[bi].address == ii->first)
break;
++bi;
}
if (bi == _bindingCount) {
udps = phy.udpBind(reinterpret_cast<const struct sockaddr *>(&(ii->first)),(void *)0,ZT_UDP_DESIRED_BUF_SIZE);
tcps = phy.tcpListen(reinterpret_cast<const struct sockaddr *>(&(ii->first)),(void *)0);
if ((udps)&&(tcps)) {
#ifdef __LINUX__
// Bind Linux sockets to their device so routes that we manage do not override physical routes (wish all platforms had this!)
if (ii->second.length() > 0) {
char tmp[256];
Utils::scopy(tmp,sizeof(tmp),ii->second.c_str());
int fd = (int)Phy<PHY_HANDLER_TYPE>::getDescriptor(udps);
if (fd >= 0)
setsockopt(fd,SOL_SOCKET,SO_BINDTODEVICE,tmp,strlen(tmp));
fd = (int)Phy<PHY_HANDLER_TYPE>::getDescriptor(tcps);
if (fd >= 0)
setsockopt(fd,SOL_SOCKET,SO_BINDTODEVICE,tmp,strlen(tmp));
}
#endif // __LINUX__
if (_bindingCount < ZT_BINDER_MAX_BINDINGS) {
_bindings[_bindingCount].udpSock = udps;
_bindings[_bindingCount].tcpListenSock = tcps;
_bindings[_bindingCount].address = ii->first;
phy.setIfName(udps,(char*)ii->second.c_str(),(int)ii->second.length());
++_bindingCount;
}
} else {
phy.close(udps,false);
phy.close(tcps,false);
}
}
}
}
/**
* @return All currently bound local interface addresses
*/
inline std::vector<InetAddress> allBoundLocalInterfaceAddresses() const
{
std::vector<InetAddress> aa;
Mutex::Lock _l(_lock);
for(unsigned int b=0,c=_bindingCount;b<c;++b)
aa.push_back(_bindings[b].address);
return aa;
}
/**
* Send from all bound UDP sockets
*/
template<typename PHY_HANDLER_TYPE>
inline bool udpSendAll(Phy<PHY_HANDLER_TYPE> &phy,const struct sockaddr_storage *addr,const void *data,unsigned int len,unsigned int ttl)
{
bool r = false;
Mutex::Lock _l(_lock);
for(unsigned int b=0,c=_bindingCount;b<c;++b) {
if (ttl) phy.setIp4UdpTtl(_bindings[b].udpSock,ttl);
if (phy.udpSend(_bindings[b].udpSock,(const struct sockaddr *)addr,data,len)) r = true;
if (ttl) phy.setIp4UdpTtl(_bindings[b].udpSock,255);
}
return r;
}
/**
* @param addr Address to check
* @return True if this is a bound local interface address
*/
inline bool isBoundLocalInterfaceAddress(const InetAddress &addr) const
{
Mutex::Lock _l(_lock);
for(unsigned int b=0;b<_bindingCount;++b) {
if (_bindings[b].address == addr)
return true;
}
return false;
}
/**
* Quickly check that a UDP socket is valid
*
* @param udpSock UDP socket to check
* @return True if socket is currently bound/allocated
*/
inline bool isUdpSocketValid(PhySocket *const udpSock)
{
for(unsigned int b=0,c=_bindingCount;b<c;++b) {
if (_bindings[b].udpSock == udpSock)
return (b < _bindingCount); // double check atomic which may have changed
}
return false;
}
private:
_Binding _bindings[ZT_BINDER_MAX_BINDINGS];
std::atomic<unsigned int> _bindingCount;
Mutex _lock;
};
} // namespace ZeroTier
#endif
-287
View File
@@ -1,287 +0,0 @@
/*
* Copyright (c)2019 ZeroTier, Inc.
*
* Use of this software is governed by the Business Source License included
* in the LICENSE.TXT file in the project's root directory.
*
* Change Date: 2023-01-01
*
* On the date above, in accordance with the Business Source License, use
* of this software will be governed by version 2.0 of the Apache License.
*/
/****/
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include "Http.hpp"
#include "Phy.hpp"
#include "OSUtils.hpp"
#include "../node/Constants.hpp"
#include "../node/Utils.hpp"
#ifdef ZT_USE_SYSTEM_HTTP_PARSER
#include <http_parser.h>
#else
#include "../ext/http-parser/http_parser.h"
#endif
namespace ZeroTier {
namespace {
static int ShttpOnMessageBegin(http_parser *parser);
static int ShttpOnUrl(http_parser *parser,const char *ptr,size_t length);
#if (HTTP_PARSER_VERSION_MAJOR >= 2) && (HTTP_PARSER_VERSION_MINOR >= 2)
static int ShttpOnStatus(http_parser *parser,const char *ptr,size_t length);
#else
static int ShttpOnStatus(http_parser *parser);
#endif
static int ShttpOnHeaderField(http_parser *parser,const char *ptr,size_t length);
static int ShttpOnValue(http_parser *parser,const char *ptr,size_t length);
static int ShttpOnHeadersComplete(http_parser *parser);
static int ShttpOnBody(http_parser *parser,const char *ptr,size_t length);
static int ShttpOnMessageComplete(http_parser *parser);
#if (HTTP_PARSER_VERSION_MAJOR >= 2) && (HTTP_PARSER_VERSION_MINOR >= 1)
static const struct http_parser_settings HTTP_PARSER_SETTINGS = {
ShttpOnMessageBegin,
ShttpOnUrl,
ShttpOnStatus,
ShttpOnHeaderField,
ShttpOnValue,
ShttpOnHeadersComplete,
ShttpOnBody,
ShttpOnMessageComplete
};
#else
static const struct http_parser_settings HTTP_PARSER_SETTINGS = {
ShttpOnMessageBegin,
ShttpOnUrl,
ShttpOnHeaderField,
ShttpOnValue,
ShttpOnHeadersComplete,
ShttpOnBody,
ShttpOnMessageComplete
};
#endif
struct HttpPhyHandler
{
// not used
inline void phyOnDatagram(PhySocket *sock,void **uptr,const struct sockaddr *localAddr,const struct sockaddr *from,void *data,unsigned long len) {}
inline void phyOnTcpAccept(PhySocket *sockL,PhySocket *sockN,void **uptrL,void **uptrN,const struct sockaddr *from) {}
inline void phyOnTcpConnect(PhySocket *sock,void **uptr,bool success)
{
if (success) {
phy->setNotifyWritable(sock,true);
} else {
*responseBody = "connection failed";
error = true;
done = true;
}
}
inline void phyOnTcpClose(PhySocket *sock,void **uptr)
{
done = true;
}
inline void phyOnTcpData(PhySocket *sock,void **uptr,void *data,unsigned long len)
{
lastActivity = OSUtils::now();
http_parser_execute(&parser,&HTTP_PARSER_SETTINGS,(const char *)data,len);
if ((parser.upgrade)||(parser.http_errno != HPE_OK))
phy->close(sock);
}
inline void phyOnTcpWritable(PhySocket *sock,void **uptr)
{
if (writePtr < (unsigned long)writeBuf.length()) {
long n = phy->streamSend(sock,writeBuf.data() + writePtr,(unsigned long)writeBuf.length() - writePtr,true);
if (n > 0)
writePtr += n;
}
if (writePtr >= (unsigned long)writeBuf.length())
phy->setNotifyWritable(sock,false);
}
inline void phyOnFileDescriptorActivity(PhySocket *sock,void **uptr,bool readable,bool writable) {}
#ifdef __UNIX_LIKE__
inline void phyOnUnixAccept(PhySocket *sockL,PhySocket *sockN,void **uptrL,void **uptrN) {}
inline void phyOnUnixClose(PhySocket *sock,void **uptr) {}
inline void phyOnUnixData(PhySocket *sock,void **uptr,void *data,unsigned long len) {}
inline void phyOnUnixWritable(PhySocket *sock,void **uptr) {}
#endif // __UNIX_LIKE__
http_parser parser;
std::string currentHeaderField;
std::string currentHeaderValue;
unsigned long messageSize;
unsigned long writePtr;
uint64_t lastActivity;
std::string writeBuf;
unsigned long maxResponseSize;
std::map<std::string,std::string> *responseHeaders;
std::string *responseBody;
bool error;
bool done;
Phy<HttpPhyHandler *> *phy;
PhySocket *sock;
};
static int ShttpOnMessageBegin(http_parser *parser)
{
return 0;
}
static int ShttpOnUrl(http_parser *parser,const char *ptr,size_t length)
{
return 0;
}
#if (HTTP_PARSER_VERSION_MAJOR >= 2) && (HTTP_PARSER_VERSION_MINOR >= 2)
static int ShttpOnStatus(http_parser *parser,const char *ptr,size_t length)
#else
static int ShttpOnStatus(http_parser *parser)
#endif
{
/*
HttpPhyHandler *hh = reinterpret_cast<HttpPhyHandler *>(parser->data);
hh->messageSize += (unsigned long)length;
if (hh->messageSize > hh->maxResponseSize)
return -1;
*/
return 0;
}
static int ShttpOnHeaderField(http_parser *parser,const char *ptr,size_t length)
{
HttpPhyHandler *hh = reinterpret_cast<HttpPhyHandler *>(parser->data);
hh->messageSize += (unsigned long)length;
if (hh->messageSize > hh->maxResponseSize)
return -1;
if ((hh->currentHeaderField.length())&&(hh->currentHeaderValue.length())) {
(*hh->responseHeaders)[hh->currentHeaderField] = hh->currentHeaderValue;
hh->currentHeaderField = "";
hh->currentHeaderValue = "";
}
for(size_t i=0;i<length;++i)
hh->currentHeaderField.push_back(OSUtils::toLower(ptr[i]));
return 0;
}
static int ShttpOnValue(http_parser *parser,const char *ptr,size_t length)
{
HttpPhyHandler *hh = reinterpret_cast<HttpPhyHandler *>(parser->data);
hh->messageSize += (unsigned long)length;
if (hh->messageSize > hh->maxResponseSize)
return -1;
hh->currentHeaderValue.append(ptr,length);
return 0;
}
static int ShttpOnHeadersComplete(http_parser *parser)
{
HttpPhyHandler *hh = reinterpret_cast<HttpPhyHandler *>(parser->data);
if ((hh->currentHeaderField.length())&&(hh->currentHeaderValue.length()))
(*hh->responseHeaders)[hh->currentHeaderField] = hh->currentHeaderValue;
return 0;
}
static int ShttpOnBody(http_parser *parser,const char *ptr,size_t length)
{
HttpPhyHandler *hh = reinterpret_cast<HttpPhyHandler *>(parser->data);
hh->messageSize += (unsigned long)length;
if (hh->messageSize > hh->maxResponseSize)
return -1;
hh->responseBody->append(ptr,length);
return 0;
}
static int ShttpOnMessageComplete(http_parser *parser)
{
HttpPhyHandler *hh = reinterpret_cast<HttpPhyHandler *>(parser->data);
hh->phy->close(hh->sock);
return 0;
}
} // anonymous namespace
unsigned int Http::_do(
const char *method,
unsigned long maxResponseSize,
unsigned long timeout,
const struct sockaddr *remoteAddress,
const char *path,
const std::map<std::string,std::string> &requestHeaders,
const void *requestBody,
unsigned long requestBodyLength,
std::map<std::string,std::string> &responseHeaders,
std::string &responseBody)
{
try {
responseHeaders.clear();
responseBody = "";
HttpPhyHandler handler;
http_parser_init(&(handler.parser),HTTP_RESPONSE);
handler.parser.data = (void *)&handler;
handler.messageSize = 0;
handler.writePtr = 0;
handler.lastActivity = OSUtils::now();
try {
char tmp[1024];
OSUtils::ztsnprintf(tmp,sizeof(tmp),"%s %s HTTP/1.1\r\n",method,path);
handler.writeBuf.append(tmp);
for(std::map<std::string,std::string>::const_iterator h(requestHeaders.begin());h!=requestHeaders.end();++h) {
OSUtils::ztsnprintf(tmp,sizeof(tmp),"%s: %s\r\n",h->first.c_str(),h->second.c_str());
handler.writeBuf.append(tmp);
}
handler.writeBuf.append("\r\n");
if ((requestBody)&&(requestBodyLength))
handler.writeBuf.append((const char *)requestBody,requestBodyLength);
} catch ( ... ) {
responseBody = "request too large";
return 0;
}
if (maxResponseSize) {
handler.maxResponseSize = maxResponseSize;
} else {
handler.maxResponseSize = 2147483647;
}
handler.responseHeaders = &responseHeaders;
handler.responseBody = &responseBody;
handler.error = false;
handler.done = false;
Phy<HttpPhyHandler *> phy(&handler,true,true);
bool instantConnect = false;
handler.phy = &phy;
handler.sock = phy.tcpConnect((const struct sockaddr *)remoteAddress,instantConnect,(void *)0,true);
if (!handler.sock) {
responseBody = "connection failed (2)";
return 0;
}
while (!handler.done) {
phy.poll(timeout / 2);
if ((timeout)&&((unsigned long)(OSUtils::now() - handler.lastActivity) > timeout)) {
phy.close(handler.sock);
responseBody = "timed out";
return 0;
}
}
return ((handler.error) ? 0 : ((handler.parser.http_errno != HPE_OK) ? 0 : handler.parser.status_code));
} catch (std::exception &exc) {
responseBody = exc.what();
return 0;
} catch ( ... ) {
responseBody = "unknown exception";
return 0;
}
}
} // namespace ZeroTier
Loaded 20 of 864 files, more files were not shown because too many files have changed in this diff. Show more