2016-02-21 13:57:56 -05:00
|
|
|
namespace Components
|
|
|
|
{
|
|
|
|
class Auth : public Component
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Auth();
|
|
|
|
~Auth();
|
|
|
|
const char* GetName() { return "Auth"; };
|
2016-02-21 18:01:20 -05:00
|
|
|
bool UnitTest();
|
2016-02-21 13:57:56 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
enum AuthState
|
|
|
|
{
|
|
|
|
STATE_UNKNOWN,
|
|
|
|
STATE_NEGOTIATING,
|
|
|
|
STATE_VALID,
|
|
|
|
STATE_INVALID,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct AuthInfo
|
|
|
|
{
|
|
|
|
Utils::Cryptography::ECDSA::Key publicKey;
|
|
|
|
std::string challenge;
|
|
|
|
AuthState state;
|
|
|
|
int time;
|
|
|
|
};
|
|
|
|
|
|
|
|
static AuthInfo ClientAuthInfo[18];
|
|
|
|
|
|
|
|
static void Frame();
|
|
|
|
|
|
|
|
static void RegisterClient(int clientNum);
|
|
|
|
static void RegisterClientStub();
|
|
|
|
};
|
|
|
|
}
|