Commit graph

58 commits

Author SHA1 Message Date
mamoniot
15a80d9a12
ran cargo fmt 2023-03-20 17:24:31 -04:00
mamoniot
b5d8290df7
fixed aes_gmac_siv 2023-03-20 17:23:29 -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
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
Sean OMeara
4692193ec4
cargo fmt
* using mips64le
* cargo fmt
2023-03-10 09:40:26 +01: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
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
181eb8ac34 cleanup 2023-01-04 11:09:21 -05:00
Adam Ierymenko
ec600f994a Add both Valid and Verified typestates. 2023-01-03 17:58:28 -05:00
Adam Ierymenko
382688d251 Generalize typestates, make verified valid because its more correct for Identity. 2023-01-03 15:24:46 -05:00
Adam Ierymenko
e3e4337d2f Merge, fix secure_eq conflict. 2022-12-21 14:46:53 -05:00
Adam Ierymenko
6517cc0cd1 secure_eq in AES for macOS 2022-12-19 15:49:44 -05:00
mamoniot
9c9510ef36 added secure_eq to a few places 2022-12-19 11:37:31 -05:00
Adam Ierymenko
5114df03d9 Make secure_eq more versatile. 2022-12-19 11:24:40 -05:00
Adam Ierymenko
4db2cfdc8c constant time EQ function 2022-12-19 10:53:12 -05:00
Adam Ierymenko
9afcc5dda3 cleanup 2022-12-16 15:36:40 -05:00
Adam Ierymenko
611ca97ee4 Post-refactor cleanup, break out some stuff some more in ZSSP. 2022-12-16 09:11:09 -05:00
Adam Ierymenko
452ecdcade Remove copy of kyber, use from GitHub with commit hash for now until next release. 2022-12-16 08:56:16 -05:00
mamoniot
d3e0de0ad8 fixed aes so it resets instead of reallocating 2022-12-14 18:14:44 -05:00
mamoniot
a7fdc82c5b switched to use of safer read and write functions 2022-12-14 12:57:10 -05:00
mamoniot
b3b0ef02b9 got to compile 2022-12-14 10:10:16 -05:00
mamoniot
987b0f0769 excised zssp 2022-12-14 10:06:49 -05:00
Adam Ierymenko
035d8203c4 A little cleanup and renaming. 2022-12-13 09:55:21 -05:00
Adam Ierymenko
57badb6e56 Also test AES-GCM decrypt and bad decrypt cases. 2022-12-06 17:54:43 -05:00
Adam Ierymenko
263900ae00 Add AES-GCM test vectors even though aes.rs is just glue... to make sure the glue holds. :) 2022-12-06 17:49:17 -05:00
Adam Ierymenko
52770ddaef Comment out set_tag_len which is not necessary and seems to crash some OpenSSL versions (are they missing it?) 2022-12-06 11:37:06 -05:00
Adam Ierymenko
7c2e0b8507 Windows fixes... not quite ported yet but almost there. 2022-12-05 16:58:33 -05:00
Adam Ierymenko
330ec11e4a Vendor openssl for Windows. 2022-12-05 15:57:15 -05:00
Adam Ierymenko
3be8a7aa6f PPC fix. 2022-12-01 13:15:10 -05:00
Adam Ierymenko
e772292d5e Fix for test errors on ZSSP. 2022-12-01 12:39:33 -05:00
Adam Ierymenko
e433b670fc ZSSP comments and cleanup. 2022-12-01 12:03:52 -05:00
Adam Ierymenko
580496cbd7 Some docs, assert AES IV is 96 bits since anything else has security issues. 2022-11-30 09:43:31 -05:00
Adam Ierymenko
7771de0bf7 Merge branch 'tetanus' of github.com:/zerotier/ZeroTierOne into tetanus 2022-11-28 12:44:36 -05:00
Adam Ierymenko
42178d1716 cleanup 2022-11-28 12:44:29 -05:00
Brenton Bostick
40cce9dba6 fix typos in comments 2022-11-28 12:36:51 -05:00
Brenton Bostick
f8351ca47e fix typos in header comment 2022-11-28 12:36:35 -05:00
Adam Ierymenko
7522282c2e docs, comments, readable code 2022-11-18 13:41:44 -05:00
Adam Ierymenko
19d973cfd4 (1) Implement typestate Verified for identity, (2) FileDatabase in controller now works. 2022-11-16 21:41:08 -05:00
Adam Ierymenko
68021b8a7f cleanup 2022-11-14 11:51:55 -05:00
Adam Ierymenko
015abb62e0
Factor out a few more warnings. 2022-11-03 15:38:23 -04:00
Adam Ierymenko
ceaba4f725
Fix some warnings by either factoring out or allowing in one case. 2022-11-03 15:37:12 -04:00
Adam Ierymenko
9e6617b324
More controller work and some ZSSP cleanup. 2022-10-27 15:03:23 -04:00
Adam Ierymenko
23e73bbdd1
cleanup 2022-10-17 12:59:10 -04:00
Adam Ierymenko
5d17c37b65
Remove parking_lot since as of 1.63 Rust std::mutex is usually as good or better. 2022-09-29 15:34:03 -04:00
Adam Ierymenko
768ec6e710
Tons more work: (1) remove async again from the core, (2) controller stuff, (3) retrofit other stuff to handle non-async core. 2022-09-21 16:43:47 -04:00
Adam Ierymenko
7ec46540fa
A ton more reorg work and controller work. 2022-09-20 12:10:05 -04:00
Adam Ierymenko
7724092551
Use 0xffffffffffff as NIL session ID because magic backward compatibility check for ZT protocol. 2022-09-20 12:09:54 -04:00
Adam Ierymenko
b8e65b667c
Build fix, cruft simplification. 2022-09-14 11:03:00 -04:00
Adam Ierymenko
3864ea8150
Fix ZSSP rate limits. 2022-09-14 09:41:40 -04:00