136 Commits

Author SHA1 Message Date
ad8ff70dc0 Merge branch 'dev'
Some checks failed
Sanitizers / build-and-test (push) Has been cancelled
2026-06-14 20:04:05 +02:00
1d9e1e6165 Version 1.2.1 - Bug Fixes
Critical (4)

C1 — udp_client.hpp / udp_client.cpp: Moved mStartReceive() out of the constructor into start(), after the socket is opened.
C2 — client/main.cpp:187: || → && in the main loop condition, so it exits when the connection drops instead of spinning forever.
C3 — tcp_connection.hpp: Added mConnectionAESKey{}, mConnectionSessionID(0), and mConnectionPublicKey{} to the constructor initializer list.
C4 — tcp_server.hpp / tcp_server.cpp: Added std::mutex mClientsMutex and locked it at all three mClients access sites (insert, erase callback, stop snapshot).
High (5)

H1 — tcp_connection.cpp:284: Replaced hardcoded htonl(0x0A0A0001) with htonl(baseIP + 1).
H2 — session_registry.hpp / session_registry.cpp / udp_server.cpp: Changed get() and getByIP() to return shared_ptr<SessionState> (non-const); removed all four const_cast usages.
H3 — session_registry.cpp:90: Guarded against mask == 0 || mask >= 32 (shift UB) and hostCount < 3 (unsigned underflow).
H4 — virtual_interface.cpp: Added runCommandWin32() using CreateProcess (no shell); replaced both system() calls in resetIP().
H5 — virtual_interface.cpp: Added close(mFd); mFd = -1; before both throw sites in the macOS constructor (ioctl failure and connect failure).
Medium (4)

M1 — tcp_connection.cpp:241: Added explicit find() + end-iterator check for NETWORK and SUBNET_MASK before dereferencing.
M2 — tcp_message_handler.cpp: Added an 8 KB (MAX_MSG_BODY = 8192) cap on incoming message body length; oversized messages close the connection.
M3 — tcp_connection.cpp:232: Capped the session ID generation loop at 16 attempts before disconnecting.
M4 — session_registry.cpp:8: put() now evicts the old IP→session mapping before replacing an entry, preventing stale mIPSessions entries.
2026-06-14 20:02:50 +02:00
05febee79e Key loading from files 2026-05-29 10:45:20 +02:00
afe10bbb6e Context fill-in and CI tests
This commit adds common units tests and CI sanitasion.
Additional context for commit b64d9c4498:
 - Fixed macOS/Linux non-portable and unsafe shell usage by adding a posix_spawn helper and replacing system() calls in virtual_interface.cpp.
 - Fixed SessionRegistry::erase() to remove mIPSessions and mSessionIPs entries in session_registry.cpp.
 - Prevented message-length truncation in tcp_message_handler.cpp by rejecting payloads > 65535 bytes.
 - Validated handshake message sizes and removed silent truncation in:
  - tcp_connection.cpp
  - tcp_client.cpp
 - Canonicalized and validated config and whitelist paths in utils.cpp using std::filesystem.
 - Hardened environment-provided config path handling in main.cpp.
 - Validated UDP ciphertext lengths and fixed session ID endianness in udp_client.cpp.
 - Scheduled periodic SessionRegistry::cleanupExpired() in main.cpp (every 5 minutes).
2026-05-25 12:29:19 +02:00
60795c60d8 minor fixes relating to nonce overflows, size checks, etc. 2026-05-25 12:22:33 +02:00
b64d9c4498 High priority and critical issues 2026-05-25 12:19:24 +02:00
604e4ace0f Addressing some bugs regarding lifetimes and callbacks that could trigger random-ish crashed - wip 2026-03-17 17:00:20 +01:00
6484f8f5c6 Merge branch 'beta' v1.1.0 2026-02-13 13:06:18 +01:00
31cb3d0a02 Merge branch 'dev' into beta 2026-02-13 13:05:59 +01:00
1136892c5d Log proto version on client 2026-02-13 13:05:34 +01:00
918b80931e Merge branch 'beta' - Version 1.1.0
This version introduces protocol version 2:
 - UDP Headers stripped to 16 Bytes, allowing more throughput
 - Nonce is derived, but unique every packet - allows faster sending
2026-02-10 19:35:19 +01:00
0299b03d9c Merge branch 'dev' into beta - Version 1.1.0
This version introduces protocol version 2:
 - UDP Headers stripped to 16 Bytes, allowing more throughput
 - Nonce is derived, but unique every packet - allows faster sending
2026-02-10 19:33:56 +01:00
8c54250449 enforce unique ids 2026-02-10 19:32:26 +01:00
27bd2cd2ec endianness 2026-02-10 19:24:07 +01:00
14298453b3 TESTING: protocol version 2 2026-02-10 13:27:15 +01:00
316498c745 TESTING: Move server stuff to a server session config for central/global resources 2026-02-09 14:20:26 +01:00
6d40dbe00d version update 2026-02-09 07:32:39 +01:00
757d0d251d Moved client data passing to a dedicated ClientSession class instead of passing through a bunch of pointers at init 2026-02-08 19:20:27 +01:00
07458c348b Merge branch 'beta' v1.0.1 2026-01-18 19:55:13 +01:00
204f89006f Merge branch 'dev' into beta 2026-01-18 19:54:59 +01:00
e61a429f24 Fix lowercase whitelisted_keys not being recognized as entries 2026-01-18 19:54:49 +01:00
833629486e Merge branch 'beta'; Version 1.0.1 2026-01-18 19:48:02 +01:00
57d260976c Merge branch 'dev' into beta 2026-01-18 19:47:48 +01:00
db1b919981 Fix CMakeLists for PKGBUILD 2026-01-18 19:47:15 +01:00
2117b6a62b Fix lowercase whitelisted_keys not being recognized as entries 2026-01-17 15:33:19 +01:00
cbfbcaa153 Merge branch 'beta' 2026-01-11 20:32:46 +01:00
4fa26d51d0 Merge branch 'dev' into beta 2026-01-11 20:32:28 +01:00
7d56f9db5d Update year 2026-01-10 19:10:37 +01:00
4609e85ca9 Logging uses ISO8601 instead of Unix Millis 2026-01-04 19:38:05 +01:00
154296bcdc README Update 2026-01-03 16:36:10 +01:00
867b2c953a Patch 1.0.1 START 2026-01-01 21:51:16 +01:00
83693ed1da Update README to be more clear about IPv4 forwarding 2026-01-01 21:48:42 +01:00
62335f3693 Test fixing writing bug 2026-01-01 21:27:13 +01:00
2d3d6afb07 Test: fix forwarding 2026-01-01 21:18:51 +01:00
e101f5ddd6 Merge branch 'beta' - Version 1.0.0 v1.0.0 2026-01-01 17:21:28 +01:00
e1118ccafe Merge branch 'dev' into beta 2026-01-01 17:21:15 +01:00
ccbacd1180 interface on win32 - v1 2026-01-01 17:15:58 +01:00
cf3ec30492 interface on win32 - v1 2026-01-01 17:11:02 +01:00
1d34953f25 interface on win32 - v1 2026-01-01 17:08:35 +01:00
c715a43a10 Merge branch 'beta' - Version 1.0.0 2026-01-01 16:33:21 +01:00
00f72e1a64 Merge branch 'dev' into beta - Version 1.0.0 2026-01-01 16:32:59 +01:00
b9903f5a8e Version 1.0.0 2026-01-01 16:32:48 +01:00
3cd99243ad Version 1.0.0 2026-01-01 16:32:14 +01:00
8f536abe77 Merge branch 'dev' into beta - Version 1.0.0 2026-01-01 16:23:37 +01:00
1f5a0585f3 Version 1.0.0 2026-01-01 16:22:17 +01:00
3dc5c04bf1 Auto set route on macos 2025-12-31 21:12:23 +01:00
37ddb82d9a Refactor args 2025-12-30 03:39:35 +01:00
f99036c523 Merge branch 'beta' b0.3 2025-12-29 20:28:34 +01:00
3eadd41a00 Merge branch 'dev' into beta 2025-12-29 20:28:15 +01:00
8923f45356 Add routeset to win32 2025-12-29 19:33:57 +01:00