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

Method Create

src/network/network_crypto.cpp:462–470  ·  view source on GitHub ↗

* Create a NetworkAuthenticationClientHandler. * @param password_handler The handler for when a request for password needs to be passed on to the user. * @param secret_key The location where the secret key is stored; can be overwritten when invalid. * @param public_key The location where the public key is stored; can be overwritten when invalid. */ static */

Source from the content-addressed store, hash-verified

460 * @param public_key The location where the public key is stored; can be overwritten when invalid.
461 */
462/* static */ std::unique_ptr<NetworkAuthenticationClientHandler> NetworkAuthenticationClientHandler::Create(std::shared_ptr<NetworkAuthenticationPasswordRequestHandler> password_handler, std::string &secret_key, std::string &public_key)
463{
464 auto secret = X25519AuthorizedKeyClientHandler::GetValidSecretKeyAndUpdatePublicKey(secret_key, public_key);
465 auto handler = std::make_unique<CombinedAuthenticationClientHandler>();
466 handler->Add(std::make_unique<X25519KeyExchangeOnlyClientHandler>(secret));
467 handler->Add(std::make_unique<X25519PAKEClientHandler>(secret, std::move(password_handler)));
468 handler->Add(std::make_unique<X25519AuthorizedKeyClientHandler>(secret));
469 return handler;
470}
471
472/**
473 * Create a NetworkAuthenticationServerHandler.

Callers

nothing calls this directly

Calls 3

TestMethod · 0.80
AddMethod · 0.45
CanBeUsedMethod · 0.45

Tested by

no test coverage detected