General fixes
Fixed most compiler warnings. Changed used interface from utun0/utun1 to lynx0
This commit is contained in:
@@ -66,7 +66,7 @@ int main(int argc, char** argv) {
|
||||
WintunInitialize();
|
||||
#endif
|
||||
|
||||
std::shared_ptr<VirtualInterface> tun = std::make_shared<VirtualInterface>("utun0");
|
||||
std::shared_ptr<VirtualInterface> tun = std::make_shared<VirtualInterface>("lynx0");
|
||||
log("Using virtual interface: " + tun->getName());
|
||||
|
||||
// Generate a temporary keypair, replace with actual CA signed keys later (Note, these are stored in memory)
|
||||
|
||||
@@ -118,7 +118,14 @@ namespace ColumnLynx::Net::TCP {
|
||||
std::memcpy(signPk.data(), data.data() + 1, std::min(data.size() - 1, sizeof(signPk)));
|
||||
|
||||
// We can safely store this without further checking, the client will need to send the encrypted AES key in a way where they must possess the corresponding private key anyways.
|
||||
crypto_sign_ed25519_pk_to_curve25519(mConnectionPublicKey.data(), signPk.data()); // Store the client's public encryption key key (for identification)
|
||||
int r = crypto_sign_ed25519_pk_to_curve25519(mConnectionPublicKey.data(), signPk.data()); // Store the client's public encryption key key (for identification)
|
||||
if (r != 0) {
|
||||
Utils::error("Conversion of client signing key to encryption key failed! Killing connection from " + reqAddr);
|
||||
disconnect();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Utils::debug("Client " + reqAddr + " converted public encryption key: " + Utils::bytesToHexString(mConnectionPublicKey.data(), 32));
|
||||
|
||||
Utils::debug("Key attempted connect: " + Utils::bytesToHexString(signPk.data(), signPk.size()));
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Copyright (C) 2025 DcruBro
|
||||
// Distributed under the terms of the GNU General Public License, either version 2 only or version 3. See LICENSES/ for details.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <columnlynx/server/net/tcp/tcp_server.hpp>
|
||||
|
||||
#include <cstdint>
|
||||
@@ -63,7 +61,7 @@ namespace ColumnLynx::Net::TCP {
|
||||
|
||||
// Snapshot to avoid iterator invalidation while callbacks erase()
|
||||
std::vector<std::shared_ptr<TCPConnection>> snapshot(mClients.begin(), mClients.end());
|
||||
for (auto& client : snapshot) {
|
||||
for (auto &client : snapshot) {
|
||||
try {
|
||||
client->disconnect(); // should shutdown+close the socket
|
||||
Utils::log("GRACEFUL_DISCONNECT sent to session: " + std::to_string(client->getSessionID()));
|
||||
|
||||
Reference in New Issue
Block a user