Commit graph

6315 commits

Author SHA1 Message Date
mamoniot
7ec194a6d1
ran cargo fmt 2023-03-20 15:29:02 -04:00
mamoniot
f6540e129a
added arc_pool to tetanus 2023-03-20 15:26:15 -04:00
Adam Ierymenko
d0446a965e
Fixes to crypto on macOS, a lot of cleanup, and work on full state replication for V2 VL2 (#1911)
* Move some stuff around in prep for a VL2 rework and identity rework.

* Mix ephemeral keys into "h"

* More topology stuff for VL2.

* Simplify key queue, fix macOS issues with bindings, and no need to cache PSK forever.

* Some more merge fixes.

* A bunch of ZSSP cleanup and optimization. Runs a bit faster now.

* Remove some unused util code.

* scatter gather stuff

* The scatter/gather algorithm works.

* Make OpenSSL init get called automatically at process launch, and some more scatter gather work.

* added support for cloning on EcKey

* Scatter/gather, move SG into VL2 since that is where it will be used, add an array chunker to utils::memory

* Simplify some Rust generic madness.

* docs

* Some cleanup and reorg.

* Bring back AES-GMAC-SIV tests.

* Turns out a Mutex is not really any slower...

---------

Co-authored-by: mamoniot <mamoniot@protonmail.com>
2023-03-14 15:29:20 -04:00
Monica Moniot
faf4c9a5b1
implemented noise_KKpsk0 (#1909)
* implemented noise_KKpsk0

* used cargo fmt
2023-03-13 13:21:30 -04:00
Adam Ierymenko
f66a2a7ef9
Tetanus adam (#1906)
* Move some stuff around in prep for a VL2 rework and identity rework.

* Mix ephemeral keys into "h"

* More topology stuff for VL2.

* Simplify key queue, fix macOS issues with bindings, and no need to cache PSK forever.

* Some more merge fixes.

* A bunch of ZSSP cleanup and optimization. Runs a bit faster now.
2023-03-10 17:03:22 -05:00
Monica Moniot
f2e2944658
tetanus-fixes (#1903) 2023-03-10 08:35:10 -05:00
Sean OMeara
d3baf083f1
removing mips64le (#1900) 2023-03-10 10:03:07 +01:00
Sean OMeara
4692193ec4
cargo fmt
* using mips64le
* cargo fmt
2023-03-10 09:40:26 +01:00
Sean OMeara
2cbc15c5ef
removing slower platforms from drone 2023-03-10 07:29:50 +01:00
Sean OMeara
192ee682ff
removing slower platforms from drone 2023-03-10 07:27:42 +01:00
monica
eb0425a28f
fixed multithreading bug 2023-03-10 00:22:53 -05:00
monica
285aab8080
improved pool mutex logic 2023-03-09 23:44:30 -05:00
monica
b3053f70e7
improved aes get 2023-03-09 23:24:43 -05:00
Adam Ierymenko
d170d91b8e Fix a locking issue in ZSSP and use hmac_sha512_secret everywhere, also clean up something in macOS AES. 2023-03-09 19:00:03 -05:00
Monica Moniot
164c7bf561
Tetanus custom bindings with macos and threadsafety bugfix (#1898)
* first commit

* cleared errors

* added init

* adding macos

* finished import

* fixed macos aes

* fixed lib

* improved openssl integration

* fixed multithreading bug

* broke something

* fixed bug

* got compilation working

* fixed threadsafety issue
2023-03-09 18:38:58 -05:00
monica
f906c9e0e1
added more specific NIST key usage labels 2023-03-08 16:57:29 -05:00
Adam Ierymenko
ccb5ff8e6d Add PSK to h as well. 2023-03-08 16:00:23 -05:00
Adam Ierymenko
5fbaf28c12 Mix ephemeral keys into "h" 2023-03-08 15:51:56 -05:00
Adam Ierymenko
cd6d8d36b0 Simplify some packet building code. 2023-03-08 15:03:27 -05:00
Adam Ierymenko
94b3e208e7 Ensure that the 'h' mechanism from Noise authenticates part one of the final packet in part two's MAC. 2023-03-08 14:57:32 -05:00
Adam Ierymenko
1c5de7473d Implement noise "h" 2023-03-08 14:22:47 -05:00
Adam Ierymenko
757cc88abc Make ZSSP use just GCM to simplify, and change final ACK to auth and encrypt public blob separately from meta-data. 2023-03-07 13:03:48 -05:00
Adam Ierymenko
e66477c168 docs 2023-03-06 10:53:41 -05:00
Adam Ierymenko
c4beedcd73 Merge branch 'tetanus' of http://git.int.zerotier.com/zerotier/ZeroTierOne into tetanus 2023-03-03 13:50:29 -05:00
Sean OMeara
0c91b75bbd silence compiler warnings about _unused_variables (#1852)
Tetanus noise xk (#1881)

* Noise XK work in progress.

* A whole lot more Noise_XK work... exchange almost done.

* Delete a bunch of commented out old Noise_IK code.

* Add back in send() and a few other things to Noise_XK ZSSP.

* Some p384 experiment in attic

* A ton of ZSSP work, and put MPL on ZSSP.

* updated kbkdf512 to use the modern nist standard

* Parameterize KBKDF on resulting output key size the way NIST likes.

* updated variable comment

* Make the label a const parameter on kbkdf.

* updated variable comment

* Add MPL to utils and other stuff.

* layout tweak

* Some more ZSSP work and a VDF we may use.

* warning removal

* More ZSSP work, add benchmarks for mimcvdf.

* Almost ready to test...

* Build fix.

* Add automatic retransmission in the earliest stages of session init.

* Just about ready to test... wow.

* It opens a session.

* ZSSP basically works...

---------

Co-authored-by: mamoniot <mamoniot@protonmail.com>

Warning removal.

remove old docs

Remove old tests from ZSSP, new test in main() can also be made into a unit test in the future.

Add key_info() to get key information.

Rekeying is now tested and works.

Show key fingerprint.

Factor out memory:: stuff, does not appear to have any real performance benefit.

Rework defragmentation, and it now tolerates very poor link quality pretty well.

Circuit breaker for incoming defrag queue, and ZSSP now works very well even under very poor network conditions.

Format tweak.

ZSSP API updates.

Just a bit of final ZSSP cleanup before moving to another thing.
2023-03-03 13:47:22 -05:00
Adam Ierymenko
3f6c7f27a1 Just a bit of final ZSSP cleanup before moving to another thing. 2023-03-03 13:46:58 -05:00
Adam Ierymenko
4360e0b487 ZSSP API updates. 2023-03-03 11:08:12 -05:00
Adam Ierymenko
781b5eb270 Format tweak. 2023-03-03 09:49:25 -05:00
Adam Ierymenko
bbeff32bce Circuit breaker for incoming defrag queue, and ZSSP now works very well even under very poor network conditions. 2023-03-03 09:46:23 -05:00
Adam Ierymenko
40945cf6c9 Rework defragmentation, and it now tolerates very poor link quality pretty well. 2023-03-02 19:09:31 -05:00
Adam Ierymenko
87989ac008 Factor out memory:: stuff, does not appear to have any real performance benefit. 2023-03-01 16:51:03 -05:00
Adam Ierymenko
d00cf1d534 Show key fingerprint. 2023-03-01 14:32:20 -05:00
Adam Ierymenko
8b6c9051fb Rekeying is now tested and works. 2023-03-01 14:01:30 -05:00
Adam Ierymenko
652f7360f0 Add key_info() to get key information. 2023-03-01 09:22:10 -05:00
Adam Ierymenko
8b6088f335 Remove old tests from ZSSP, new test in main() can also be made into a unit test in the future. 2023-02-28 18:06:47 -05:00
Adam Ierymenko
97fc6b8ff2 remove old docs 2023-02-28 18:01:26 -05:00
Adam Ierymenko
aca394946c Warning removal. 2023-02-28 18:00:44 -05:00
Adam Ierymenko
5cf99ecb1d
Tetanus noise xk (#1881)
* Noise XK work in progress.

* A whole lot more Noise_XK work... exchange almost done.

* Delete a bunch of commented out old Noise_IK code.

* Add back in send() and a few other things to Noise_XK ZSSP.

* Some p384 experiment in attic

* A ton of ZSSP work, and put MPL on ZSSP.

* updated kbkdf512 to use the modern nist standard

* Parameterize KBKDF on resulting output key size the way NIST likes.

* updated variable comment

* Make the label a const parameter on kbkdf.

* updated variable comment

* Add MPL to utils and other stuff.

* layout tweak

* Some more ZSSP work and a VDF we may use.

* warning removal

* More ZSSP work, add benchmarks for mimcvdf.

* Almost ready to test...

* Build fix.

* Add automatic retransmission in the earliest stages of session init.

* Just about ready to test... wow.

* It opens a session.

* ZSSP basically works...

---------

Co-authored-by: mamoniot <mamoniot@protonmail.com>
2023-02-28 17:54:08 -05:00
Sean OMeara
52234c44fb
silence compiler warnings about _unused_variables (#1852) 2023-01-18 10:27:25 -05:00
Sean OMeara
b622475357 README cleanup 2023-01-13 12:23:02 +01:00
Sean OMeara
e6c2bd76a1 tweaking github build 2023-01-12 19:26:13 +01:00
Adam Ierymenko
8eedf70a1f Fix logic to still dedup properly. 2023-01-11 20:08:27 -05:00
Adam Ierymenko
edf1fd4d69 Implement max skip-ahead for counter, which is really about filtering bad packets. 2023-01-11 20:05:35 -05:00
Adam Ierymenko
2479645341 Put key index inside the encrypted part of the header. 2023-01-11 19:54:04 -05:00
Adam Ierymenko
3db9603799 Change the header yet again to encrypt everything but the session ID and key index. 2023-01-11 19:31:58 -05:00
Adam Ierymenko
8202a831b2 Rename to be more descriptive. 2023-01-06 20:51:28 -05:00
Adam Ierymenko
0c18d9563e Fix FileDatabase test failure. 2023-01-06 20:46:38 -05:00
Adam Ierymenko
d2b49130b2 Fix tests, remove some dead code, fix a bug that prevented rekey rate limiting from working. 2023-01-06 20:39:20 -05:00
Adam Ierymenko
73e6be7959 Re-implement most of what Monica originally did, but with some variations:
- Went back to a single session counter instead of two counter states
 - Went to a full 64-bit counter in the header as recommended by Noise, turns
   out there is a good reason. It simplifies everything.
 - Implemented Monica's simpler stateless counter window algorithm, but
   also only one on the whole session.
 - Simplified some counter logic generally.
 - Header check codes are temporarily gone, coming back in a different form.

This is being committed "on top" of what was there instead of reverting the old
commits to preserve the history.
2023-01-06 19:51:09 -05:00
Sean OMeara
4f0a704640
Sometanus (#1835)
* adding smiley
2023-01-06 20:24:47 +01:00