projects
/
pgweb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6a860f
)
Fix password type identifications
author
Magnus Hagander
<magnus@hagander.net>
Sat, 26 Sep 2020 15:50:44 +0000
(17:50 +0200)
committer
Magnus Hagander
<magnus@hagander.net>
Sat, 26 Sep 2020 15:50:44 +0000
(17:50 +0200)
Sha1's start with sha1$, not sha1_ (and this is not a SQL LIKE match).
And fix parameters when calling re.match in the unmatched case.
pgweb/account/admin.py
patch
|
blob
|
blame
|
history
diff --git
a/pgweb/account/admin.py
b/pgweb/account/admin.py
index 723b9f77aaf669cf8ca59d492b972edfbb11727e..b47ba90e0256b6f1d265782307deab702c3417f3 100644
(file)
--- a/
pgweb/account/admin.py
+++ b/
pgweb/account/admin.py
@@
-80,9
+80,9
@@
class PGUserChangeForm(UserChangeForm):
return "OAuth integrated"
elif obj.password.startswith('pbkdf2_'):
return "Regular password"
- elif obj.password.startswith('sha1
_
'):
+ elif obj.password.startswith('sha1
$
'):
return "Old SHA1 password"
- elif re.match('^[a-z0-9]{64}'):
+ elif re.match('^[a-z0-9]{64}'
, obj.password
):
return "Old unknown hash"
else:
return "Unknown"