Switched to C++23 as the project standard.
Added a basic parser for client_config and server_config, and added some basic authorization. Need to work on verification of the server.
This commit is contained in:
@@ -49,6 +49,9 @@ int main(int argc, char** argv) {
|
||||
auto result = options.parse(argc, argv);
|
||||
if (result.count("help")) {
|
||||
std::cout << options.help() << std::endl;
|
||||
std::cout << "This software is licensed under the GPLv2-only license OR the GPLv3 license.\n";
|
||||
std::cout << "Copyright (C) 2025, The ColumnLynx Contributors.\n";
|
||||
std::cout << "This software is provided under ABSOLUTELY NO WARRANTY, to the extent permitted by law.\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -67,6 +70,8 @@ int main(int argc, char** argv) {
|
||||
log("Using virtual interface: " + tun->getName());
|
||||
|
||||
LibSodiumWrapper sodiumWrapper = LibSodiumWrapper();
|
||||
debug("Public Key: " + Utils::bytesToHexString(sodiumWrapper.getPublicKey(), 32));
|
||||
debug("Private Key: " + Utils::bytesToHexString(sodiumWrapper.getPrivateKey(), 64));
|
||||
|
||||
std::array<uint8_t, 32> aesKey = {0}; // Defualt zeroed state until modified by handshake
|
||||
uint64_t sessionID = 0;
|
||||
|
||||
@@ -33,9 +33,13 @@ namespace ColumnLynx::Net::TCP {
|
||||
std::vector<uint8_t> payload;
|
||||
payload.reserve(1 + crypto_box_PUBLICKEYBYTES);
|
||||
payload.push_back(Utils::protocolVersion());
|
||||
payload.insert(payload.end(),
|
||||
/*payload.insert(payload.end(),
|
||||
mLibSodiumWrapper->getXPublicKey(),
|
||||
mLibSodiumWrapper->getXPublicKey() + crypto_box_PUBLICKEYBYTES
|
||||
);*/
|
||||
payload.insert(payload.end(),
|
||||
mLibSodiumWrapper->getPublicKey(),
|
||||
mLibSodiumWrapper->getPublicKey() + crypto_sign_PUBLICKEYBYTES
|
||||
);
|
||||
|
||||
mHandler->sendMessage(ClientMessageType::HANDSHAKE_INIT, Utils::uint8ArrayToString(payload.data(), payload.size()));
|
||||
|
||||
Reference in New Issue
Block a user