mirror of
https://github.com/znc/znc.git
synced 2026-08-07 01:13:25 +02:00
User,Utils: move ConstantTimeEquals to CUtils and add tests (#2011)
This commit is contained in:
@@ -62,6 +62,11 @@ class CUtils {
|
||||
static CString SaltedMD5Hash(const CString& sPass, const CString& sSalt);
|
||||
static CString SaltedSHA256Hash(const CString& sPass, const CString& sSalt);
|
||||
static CString SaltedHash(const CString& sPass, const CString& sSalt);
|
||||
/** Byte-wise compare in time proportional to the shorter of the two
|
||||
* lengths, without short-circuiting on the first differing byte. Used
|
||||
* for password / hash comparisons so a remote attacker can't recover
|
||||
* the stored secret one byte at a time via response timing. */
|
||||
static bool ConstantTimeEquals(const CString& a, const CString& b);
|
||||
static CString GetPass(const CString& sPrompt);
|
||||
static bool GetInput(const CString& sPrompt, CString& sRet,
|
||||
const CString& sDefault = "",
|
||||
|
||||
Reference in New Issue
Block a user