summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2012-05-09 21:11:25 +0200
committerFlorian Bruhin <me@the-compiler.org>2012-05-09 21:11:25 +0200
commita31681cbb2377c9b14384ec290dcf5c64a1e1518 (patch)
tree2ed48852716179c91d07c171b08ac2d7ce9aff66
parentbc45c241a6f6b199991b1e94642e0146edc95f77 (diff)
downloadsgp-a31681cbb2377c9b14384ec290dcf5c64a1e1518.tar.gz
sgp-a31681cbb2377c9b14384ec290dcf5c64a1e1518.zip
Fix password-generating bug.
Did output the wrong password for some URLs :( We checked if the generated MD5sum matches ^[a-z].*[0-9A-Z].* but this also would match xxxxxxxx99 while sgp says "needs to start with a lower letter and contain at least a digit AND an uppercase letter". Thanks to portix!
-rwxr-xr-xsgp.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sgp.py b/sgp.py
index 6f5fa88..1671a8e 100755
--- a/sgp.py
+++ b/sgp.py
@@ -36,7 +36,7 @@ def sgp_gen(pwd, length):
for i in range(10):
pwd = b64_md5(pwd)
- while not re.match('^[a-z].*[A-Z0-9].*', pwd[:length]):
+ while not re.match('^[a-z].*([A-Z].*[0-9]|[0-9].*[A-Z]).*', pwd[:length]):
pwd = b64_md5(pwd)
return(pwd[:length])