Permalink
Browse files

Rename singleton accessor

  • Loading branch information...
mbasaglia committed Nov 4, 2015
1 parent b4733a8 commit 804ff0434887b1aaee6a620eaf75d13b023a0f34
@@ -310,7 +310,7 @@ class Aes256 : public Algorithm
class Library
{
public:
static Library& Instance()
static Library& Get()
{
static Library singleton;
return singleton;
@@ -377,7 +377,7 @@ class Encryptor
explicit Encryptor( const std::string& algo_name, const std::string& passphrase )
: Encryptor(
Library::Instance().EncryptionAlgorithm(algo_name),
Library::Get().EncryptionAlgorithm(algo_name),
passphrase
)
{}
@@ -516,7 +516,7 @@ class Challenge
class ChallengeManager
{
public:
static ChallengeManager& Instance()
static ChallengeManager& Get()
{
static ChallengeManager singleton;
return singleton;
@@ -107,7 +107,7 @@ void SV_GetChallenge( netadr_t from )
void SV_GetChallengeNew( netadr_t from )
{
auto challenge = ChallengeManager::Instance().GenerateChallenge( from );
auto challenge = ChallengeManager::Get().GenerateChallenge( from );
NET_OutOfBandPrint( NS_SERVER, from, "challengeResponseNew %s\n", challenge.c_str() );
}
@@ -876,7 +876,7 @@ void SVC_SecureRemoteCommand( netadr_t from, const Cmd::Args& args )
std::getline( stream, command );
Challenge challenge( from, Crypto::Encoding::HexDecode(Crypto::String(challenge_hex)) );
if ( !stream || !ChallengeManager::Instance().Match(challenge) )
if ( !stream || !ChallengeManager::Get().Match(challenge) )
{
throw Crypto::Error("Mismatched challenge");
}

0 comments on commit 804ff04

Please sign in to comment.