33 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
6484f8f5c6 Merge branch 'beta' 2026-02-13 13:06:18 +01:00
31cb3d0a02 Merge branch 'dev' into beta 2026-02-13 13:05:59 +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
07458c348b Merge branch 'beta' 2026-01-18 19:55:13 +01:00
204f89006f Merge branch 'dev' into beta 2026-01-18 19:54:59 +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
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
e101f5ddd6 Merge branch 'beta' - Version 1.0.0 2026-01-01 17:21:28 +01:00
e1118ccafe Merge branch 'dev' into beta 2026-01-01 17:21:15 +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
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
f99036c523 Merge branch 'beta' 2025-12-29 20:28:34 +01:00
3eadd41a00 Merge branch 'dev' into beta 2025-12-29 20:28:15 +01:00
471224b043 Merge branch 'beta' - b0.3 2025-12-29 19:07:16 +01:00
714aa52f98 Merge branch 'dev' into beta 2025-12-29 19:06:59 +01:00
cb0f674c52 Merge branch 'beta' - Version b0.1
macOS Support
2025-12-08 17:38:05 +01:00
a2ecc589f8 Merge branch 'dev' into beta - Version b0.1 2025-12-08 17:37:44 +01:00
33bbd7cce6 Merge branch 'beta' - Alpha 0.6
This version adds Dynamic IP assignment based on config.
2025-12-02 18:47:58 +01:00
640a751f9b Merge branch 'dev' into beta - Alpha 0.6
This version adds dynamic IP assignment based on config.
2025-12-02 18:46:28 +01:00
f9c5c56a1b Merge branch 'beta'
This is the merge of version a0.5 into master.
This version adds general authentication of the client and server, and control of connection via key whitelisting.
Also added loading of keypairs via a config file system.
2025-11-28 19:31:01 +01:00
a08dba5b59 Merge branch 'dev' into beta
This is the merge of version a0.5 into beta.
This version adds general authentication of the client and server, and control of connection via key whitelisting.
Also added loading of keypairs via a config file system.
2025-11-28 19:27:15 +01:00
17dd504a7a Merge pull request 'First working alpha, version a0.4' (#7) from beta into master
Reviewed-on: #7
2025-11-18 20:09:11 +00:00
4ba59fb23f Merge pull request 'First working alpha, version a0.4.' (#6) from dev into beta
Reviewed-on: #6
2025-11-18 20:07:30 +00:00
9f52bdd54c Merge pull request 'beta' (#4) from beta into master
Reviewed-on: #4
2025-11-10 15:58:29 +00:00
9e5e728438 Merge pull request 'Add legal clarification' (#3) from dev into beta
Reviewed-on: #3
2025-11-10 15:58:18 +00:00
29e90938c5 Merge pull request 'beta - Update License' (#2) from beta into master
Reviewed-on: #2
2025-11-10 15:15:31 +00:00
d20bee9e60 Merge pull request 'Update license' (#1) from dev into beta
Reviewed-on: #1
2025-11-10 15:15:10 +00:00
3 changed files with 6 additions and 39 deletions

View File

@@ -182,31 +182,15 @@ int main(int argc, char** argv) {
debug("Client connection flag: " + std::to_string(client->isConnected())); debug("Client connection flag: " + std::to_string(client->isConnected()));
debug("Client handshake flag: " + std::to_string(client->isHandshakeComplete())); debug("Client handshake flag: " + std::to_string(client->isHandshakeComplete()));
debug("isDone flag: " + std::to_string(done)); debug("isDone flag: " + std::to_string(done));
// Phase 1: wait for the async TCP connect to succeed (or time out). // Client is running
// isConnected() is set by the io_context thread once async_connect fires.
{
auto deadline = std::chrono::steady_clock::now() + std::chrono::seconds(30);
while (!client->isConnected() && !done) {
if (std::chrono::steady_clock::now() >= deadline) {
error("Connection timed out after 30 seconds.");
break;
}
std::this_thread::sleep_for(std::chrono::milliseconds(20));
}
}
// Phase 2: packet-forwarding loop — runs while the TCP connection is alive.
// sendMessage() in the UDP client already guards against pre-handshake sends
// (it checks AES key / session ID), so entering here before the handshake
// finishes is harmless.
while (client->isConnected() && !done) { while (client->isConnected() && !done) {
//debug("Client connection flag: " + std::to_string(client->isConnected())); //debug("Client connection flag: " + std::to_string(client->isConnected()));
auto packet = tun->readPacket(); auto packet = tun->readPacket();
/*if (!client->isConnected() || done) { /*if (!client->isConnected() || done) {
break; // Bail out if connection died or signal set while blocked break; // Bail out if connection died or signal set while blocked
}*/ }*/
if (packet.empty()) { if (packet.empty()) {
continue; continue;
} }

View File

@@ -443,26 +443,9 @@ static bool runCommand(const std::vector<std::string>& args) {
std::string netArg = ipStr + " " + peerStr; // ifconfig expects ip peer std::string netArg = ipStr + " " + peerStr; // ifconfig expects ip peer
runCommand({"ifconfig", mIfName, "inet", ipStr, peerStr, "mtu", std::to_string(mtu), "netmask", prefixStr, "up"}); runCommand({"ifconfig", mIfName, "inet", ipStr, peerStr, "mtu", std::to_string(mtu), "netmask", prefixStr, "up"});
// Compute the correct network address from the client IP and prefix length. // Add route for the network
// Using the raw host IP (ipStr) here would create a host route for 10.10.0.2 std::string networkArg = ipStr + "/" + std::to_string(prefixLen);
// instead of the intended network route for 10.10.0.0/24, causing traffic
// destined for the peer (10.10.0.1) to miss this route entirely.
uint32_t rawMask = (prefixLen == 0) ? 0u : (0xFFFFFFFFu << (32 - prefixLen));
uint32_t networkIP = clientIP & rawMask;
std::string networkStr = ipv4ToString(networkIP);
std::string networkArg = networkStr + "/" + std::to_string(prefixLen);
// Delete stale routes first so we can (re)add cleanly.
// These are best-effort — failure just means the route didn't exist.
runCommand({"route", "-n", "delete", "-net", networkArg});
runCommand({"route", "-n", "delete", "-host", peerStr});
// Add the VPN subnet route.
runCommand({"route", "-n", "add", "-net", networkArg, "-interface", mIfName}); runCommand({"route", "-n", "add", "-net", networkArg, "-interface", mIfName});
// Force an explicit host route for the peer so our utun wins over any
// competing /24 route that another tunnel may have installed.
runCommand({"route", "-n", "add", "-host", peerStr, "-interface", mIfName});
return true; return true;
} }

View File

@@ -34,7 +34,7 @@ namespace ColumnLynx::Net::UDP {
// Get plaintext session ID (first 4 bytes after header, in network byte order) // Get plaintext session ID (first 4 bytes after header, in network byte order)
uint32_t sessionIDNet = 0; uint32_t sessionIDNet = 0;
std::memcpy(&sessionIDNet, mRecvBuffer.data() + sizeof(UDPPacketHeader), sizeof(uint32_t)); std::memcpy(&sessionIDNet, mRecvBuffer.data() + sizeof(UDPPacketHeader), sizeof(uint32_t));
uint32_t sessionID = ntohl(sessionIDNet); uint32_t sessionID = sessionIDNet; // ntohl(sessionIDNet); --- IGNORE ---
auto it = mRecvBuffer.begin() + sizeof(UDPPacketHeader) + sizeof(uint32_t); auto it = mRecvBuffer.begin() + sizeof(UDPPacketHeader) + sizeof(uint32_t);
std::vector<uint8_t> encryptedPayload(it, mRecvBuffer.begin() + bytes); std::vector<uint8_t> encryptedPayload(it, mRecvBuffer.begin() + bytes);