PICrypt passwordHash fix hash and return, PICloud repair Server exit, fix PIAuth pass_hash gen

This commit is contained in:
2021-04-08 11:53:10 +03:00
parent 4584d9c639
commit f0e2410929
6 changed files with 18 additions and 16 deletions

View File

@@ -30,7 +30,7 @@ PIAuth::PIAuth(const PIByteArray & sign) : PIObject() {
void PIAuth::setServerPassword(const PIString & ps) {
pass_hash = crypt.passwordHash(ps, PIByteArray::fromHex("PIAuth"));
pass_hash = crypt.passwordHash(ps, PIString("PIAuth").toByteArray());
}
@@ -127,7 +127,7 @@ PIAuth::State PIAuth::receive(PIByteArray & ba) {
PIByteArray ph;
passwordRequest(&ps);
if (ps.isEmpty()) return disconnect(ba, "Canceled by user");
ph = crypt.passwordHash(ps, PIByteArray::fromHex("PIAuth"));
ph = crypt.passwordHash(ps, PIString("PIAuth").toByteArray());
ps.fill(0);
tba.clear();
tba << ph << auth_sign << sign_pk;