forked from Telodendria/Telodendria
[MOD] Use hashtypes
Some checks failed
Compile Telodendria / Compile Telodendria (x86, alpine-v3.19) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86, debian-v12.4) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86, freebsd-v14.0) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86, netbsd-v9.3) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86_64, alpine-v3.19) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86_64, debian-v12.4) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86_64, freebsd-v14.0) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86_64, netbsd-v9.3) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86_64, openbsd-v7.4) (push) Has been cancelled
Some checks failed
Compile Telodendria / Compile Telodendria (x86, alpine-v3.19) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86, debian-v12.4) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86, freebsd-v14.0) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86, netbsd-v9.3) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86_64, alpine-v3.19) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86_64, debian-v12.4) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86_64, freebsd-v14.0) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86_64, netbsd-v9.3) (push) Has been cancelled
Compile Telodendria / Compile Telodendria (x86_64, openbsd-v7.4) (push) Has been cancelled
This commit is contained in:
parent
4bc7ae92d6
commit
1e544a4927
1 changed files with 2 additions and 2 deletions
|
@ -384,7 +384,7 @@ UserCheckPassword(User * user, char *password)
|
||||||
|
|
||||||
tmp = StrConcat(2, password, salt);
|
tmp = StrConcat(2, password, salt);
|
||||||
hashBytes = Sha256(tmp);
|
hashBytes = Sha256(tmp);
|
||||||
hashedPwd = ShaToHex(hashBytes);
|
hashedPwd = ShaToHex(hashBytes, HASH_SHA256);
|
||||||
Free(tmp);
|
Free(tmp);
|
||||||
Free(hashBytes);
|
Free(hashBytes);
|
||||||
|
|
||||||
|
@ -415,7 +415,7 @@ UserSetPassword(User * user, char *password)
|
||||||
salt = StrRandom(16);
|
salt = StrRandom(16);
|
||||||
tmpstr = StrConcat(2, password, salt);
|
tmpstr = StrConcat(2, password, salt);
|
||||||
hashBytes = Sha256(tmpstr);
|
hashBytes = Sha256(tmpstr);
|
||||||
hash = ShaToHex(hashBytes);
|
hash = ShaToHex(hashBytes, HASH_SHA256);
|
||||||
|
|
||||||
JsonValueFree(HashMapSet(json, "salt", JsonValueString(salt)));
|
JsonValueFree(HashMapSet(json, "salt", JsonValueString(salt)));
|
||||||
JsonValueFree(HashMapSet(json, "password", JsonValueString(hash)));
|
JsonValueFree(HashMapSet(json, "password", JsonValueString(hash)));
|
||||||
|
|
Loading…
Reference in a new issue