Fix fb9d4af: use different nonces for key exchange and stream encryption

This commit is contained in:
Rubidium
2024-03-31 12:41:28 +02:00
committed by rubidium42
parent 9954187680
commit d5e28a904d
7 changed files with 66 additions and 9 deletions

View File

@@ -242,6 +242,12 @@ public:
*/
virtual bool SendResponse(struct Packet &p) = 0;
/**
* Read the request to enable encryption from the server.
* @param p The request from the server.
*/
virtual bool ReceiveEnableEncryption(struct Packet &p) = 0;
static std::unique_ptr<NetworkAuthenticationClientHandler> Create(std::shared_ptr<NetworkAuthenticationPasswordRequestHandler> password_handler, std::string &secret_key, std::string &public_key);
};
@@ -270,6 +276,12 @@ public:
*/
virtual ResponseResult ReceiveResponse(struct Packet &p) = 0;
/**
* Create the request to enable encryption to the client.
* @param p The packet to write the enable encryption request to.
*/
virtual void SendEnableEncryption(struct Packet &p) = 0;
/**
* Checks whether this handler can be used with the current configuration.
* For example when there is no password, the handler cannot be used.