OpenTTD Source  20241121-master-g67a0fccfad
test_network_crypto.cpp File Reference

Tests for network related crypto functions. More...

#include "../stdafx.h"
#include "../3rdparty/catch2/catch.hpp"
#include "../core/format.hpp"
#include "../network/network_crypto_internal.h"
#include "../network/core/packet.h"
#include "../string_func.h"

Go to the source code of this file.

Data Structures

class  MockNetworkSocketHandler
 
class  TestPasswordRequestHandler
 

Functions

static std::tuple< Packet, bool > CreatePacketForReading (Packet &source, MockNetworkSocketHandler *socket_handler)
 
static void TestAuthentication (NetworkAuthenticationServerHandler &server, NetworkAuthenticationClientHandler &client, NetworkAuthenticationServerHandler::ResponseResult expected_response_result, NetworkAuthenticationClientHandler::RequestResult expected_request_result)
 
 TEST_CASE ("Authentication_KeyExchangeOnly")
 
static void TestAuthenticationPAKE (std::string server_password, std::string client_password, NetworkAuthenticationServerHandler::ResponseResult expected_response_result)
 
 TEST_CASE ("Authentication_PAKE")
 
static void TestAuthenticationAuthorizedKey (const X25519SecretKey &client_secret_key, const X25519PublicKey &server_expected_public_key, NetworkAuthenticationServerHandler::ResponseResult expected_response_result)
 
 TEST_CASE ("Authentication_AuthorizedKey")
 
 TEST_CASE ("Authentication_Combined")
 
static void CheckEncryption (MockNetworkSocketHandler *sending_socket_handler, MockNetworkSocketHandler *receiving_socket_handler)
 
 TEST_CASE ("Encryption handling")
 

Variables

static MockNetworkSocketHandler mock_socket_handler
 

Detailed Description

Tests for network related crypto functions.

Definition in file test_network_crypto.cpp.