layout: Add a function to get master hash

fix: Memory leak when WinOS client login
This commit is contained in:
yuanyuanxiang
2025-07-13 04:37:14 +08:00
parent 41295ca03b
commit b4c2ed236e
9 changed files with 78 additions and 49 deletions

View File

@@ -62,7 +62,7 @@ bool WritePwdHash(char* target, const std::string & pwdHash, const Validation& v
bool IsPwdHashValid(const char* hash) {
const char* ptr = hash ? hash : g_MasterID;
if (ptr == std::string(skCrypt(MASTER_HASH)))
if (ptr == GetMasterHash())
return true;
std::string pwdHash(ptr, 64), s1(ptr +64, 32), s2(ptr +96, 4);
char output32[33], output4[5];