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

Method ReceiveRequest

src/network/network_crypto.cpp:201–211  ·  view source on GitHub ↗

* Read the key exchange data from a \c Packet that came from the server, * @param p The packet that has been received. * @return True when the data seems correct. */

Source from the content-addressed store, hash-verified

199 * @return True when the data seems correct.
200 */
201bool X25519AuthenticationHandler::ReceiveRequest(Packet &p)
202{
203 if (p.RemainingBytesToTransfer() != X25519_KEY_SIZE + X25519_NONCE_SIZE) {
204 Debug(net, 1, "[crypto] Received auth response of illegal size; authentication aborted.");
205 return false;
206 }
207
208 p.Recv_bytes(this->peer_public_key);
209 p.Recv_bytes(this->key_exchange_nonce);
210 return true;
211}
212
213/**
214 * Perform the key exchange, and when that is correct fill the \c Packet with the appropriate data.

Callers 2

TestAuthenticationFunction · 0.45

Calls 8

GetNameMethod · 0.95
Recv_bytesMethod · 0.80
Recv_uint8Method · 0.80
AskUserForPasswordMethod · 0.45
endMethod · 0.45
getMethod · 0.45

Tested by 1

TestAuthenticationFunction · 0.36