MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / TestAuthenticationAuthorizedKey

Function TestAuthenticationAuthorizedKey

src/tests/test_network_crypto.cpp:121–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119
120
121static void TestAuthenticationAuthorizedKey(const X25519SecretKey &client_secret_key, const X25519PublicKey &server_expected_public_key,
122 NetworkAuthenticationServerHandler::ResponseResult expected_response_result)
123{
124 NetworkAuthorizedKeys authorized_keys;
125 authorized_keys.Add(FormatArrayAsHex(server_expected_public_key));
126
127 NetworkAuthenticationDefaultAuthorizedKeyHandler authorized_key_handler(authorized_keys);
128 X25519AuthorizedKeyServerHandler server(X25519SecretKey::CreateRandom(), &authorized_key_handler);
129 X25519AuthorizedKeyClientHandler client(client_secret_key);
130
131 TestAuthentication(server, client, expected_response_result, NetworkAuthenticationClientHandler::RequestResult::ReadyForResponse);
132}
133
134TEST_CASE("Authentication_AuthorizedKey")
135{

Callers 1

Calls 3

FormatArrayAsHexFunction · 0.85
TestAuthenticationFunction · 0.85
AddMethod · 0.45

Tested by

no test coverage detected