core: move away from db towards hash-based auth

This commit is contained in:
Vaxry
2025-04-13 21:19:05 +01:00
parent 5f20698aa6
commit c3975b27f1
13 changed files with 444 additions and 429 deletions

26
src/core/Challenge.hpp Normal file
View File

@@ -0,0 +1,26 @@
#pragma once
#include <string>
class CChallenge {
public:
CChallenge(const std::string& fingerprint, const std::string& challenge, int difficulty);
CChallenge(const std::string& jsonResponse);
std::string fingerprint() const;
std::string challenge() const;
std::string signature() const;
bool valid() const;
private:
std::string getSigString();
std::string m_sig, m_fingerprint, m_challenge;
bool m_valid = false;
int m_difficulty = 4;
struct SChallengeJSON {
std::string fingerprint, challenge, sig;
int difficulty = 4, solution = 0;
};
};