forked from github/server
fix bcrypt use
This commit is contained in:
parent
f5a03d4501
commit
9210f77a1a
|
@ -70,9 +70,9 @@ class EPasswd:
|
|||
pw = self.get_passwd(id)
|
||||
if pw[0:4]=='$2a$' or pw[0:4]=='$2y$':
|
||||
try:
|
||||
h1 = pw.encode('utf8')
|
||||
h2 = passwd.encode('utf8')
|
||||
return bcrypt.checkpw(h1, h2)
|
||||
uhash = pw.encode('utf8')
|
||||
upass = passwd.encode('utf8')
|
||||
return bcrypt.checkpw(upass, uhash)
|
||||
except:
|
||||
return False
|
||||
return pw == passwd
|
||||
|
|
|
@ -1606,7 +1606,7 @@ int write_reports(faction * f)
|
|||
if (f->lastorders == 0 || f->age <= 1) {
|
||||
/* neue Parteien, oder solche die noch NIE einen Zug gemacht haben,
|
||||
* kriegen ein neues Passwort: */
|
||||
password = faction_genpassword(f);
|
||||
password = faction_genpassword(f, buffer);
|
||||
}
|
||||
prepare_report(&ctx, f, password);
|
||||
get_addresses(&ctx);
|
||||
|
|
Loading…
Reference in New Issue