MCPcopy Create free account
hub / github.com/ddnet/ddnet / AddKeyHash

Method AddKeyHash

src/engine/server/authmanager.cpp:85–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85int CAuthManager::AddKeyHash(const char *pIdent, MD5_DIGEST Hash, const unsigned char *pSalt, const char *pRoleName)
86{
87 if(FindKey(pIdent) >= 0)
88 return -1;
89
90 CKey Key;
91 str_copy(Key.m_aIdent, pIdent);
92 Key.m_Pw = Hash;
93 mem_copy(Key.m_aSalt, pSalt, SALT_BYTES);
94 Key.m_pRole = FindRole(pRoleName);
95 dbg_assert(Key.m_pRole != nullptr, "Invalid role name '%s'.", pRoleName);
96
97 m_vKeys.push_back(Key);
98 return m_vKeys.size() - 1;
99}
100
101int CAuthManager::AddKey(const char *pIdent, const char *pPw, const char *pRoleName)
102{

Callers 1

ConAuthAddHashedMethod · 0.80

Calls 2

mem_copyFunction · 0.85
str_copyFunction · 0.50

Tested by

no test coverage detected