r5sdk/r5dev/engine/client/cl_rcon.h
Kawe Mazidjatari b26ed2f746 Engine: implement encryption for RCON protocol
RCON lacked encryption, added AES-CTR encryption on RCON frames. Slightly adjusted protocol to take this into account (sending nonces, encrypted data itself, etc).
2024-06-01 11:24:47 +02:00

37 lines
892 B
C++

#pragma once
#include "tier1/NetAdr.h"
#include "tier2/socketcreator.h"
#include "protoc/netcon.pb.h"
#include "engine/shared/base_rcon.h"
class CRConClient : public CNetConBase
{
public:
CRConClient(void);
~CRConClient(void);
void Init(const char* pNetKey = nullptr);
void Shutdown(void);
void RunFrame(void);
virtual void Disconnect(const char* szReason = nullptr) override;
virtual bool ProcessMessage(const char* pMsgBuf, const int nMsgLen) override;
bool Serialize(vector<char>& vecBuf, const char* szReqBuf,
const char* szReqVal, const netcon::request_e requestType) const;
void RequestConsoleLog(const bool bWantLog);
bool ShouldReceive(void);
bool IsRemoteLocal(void);
bool IsInitialized(void) const;
bool IsConnected(void);
CConnectedNetConsoleData* GetData(void);
SocketHandle_t GetSocket(void);
private:
bool m_bInitialized;
};
CRConClient* RCONClient();