projects
/
mirror
/
userdir-ldap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b646eaa
)
Improvement to password hasher
author
jgg
<>
Sun, 30 Apr 2000 20:28:05 +0000
(20:28 +0000)
committer
jgg
<>
Sun, 30 Apr 2000 20:28:05 +0000
(20:28 +0000)
userdir_ldap.py
patch
|
blob
|
history
diff --git
a/userdir_ldap.py
b/userdir_ldap.py
index
07bc6b1
..
a8b62fe
100644
(file)
--- a/
userdir_ldap.py
+++ b/
userdir_ldap.py
@@
-137,7
+137,7
@@
def GenPass():
SaltVals = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/.";
Rand = open("/dev/urandom");
Password = "";
SaltVals = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/.";
Rand = open("/dev/urandom");
Password = "";
- for i in range(0,1
0
):
+ for i in range(0,1
5
):
Password = Password + SaltVals[ord(Rand.read(1)[0]) % len(SaltVals)];
return Password;
Password = Password + SaltVals[ord(Rand.read(1)[0]) % len(SaltVals)];
return Password;
@@
-147,8
+147,9
@@
def HashPass(Password):
# glibc then just change Salt = "$1$" to Salt = "";
SaltVals = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/.";
Salt = "$1$";
# glibc then just change Salt = "$1$" to Salt = "";
SaltVals = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ/.";
Salt = "$1$";
+ Rand = open("/dev/urandom");
for x in range(0,10):
for x in range(0,10):
- Salt = Salt + SaltVals[
whrandom.randint(0,len(SaltVals)-1
)];
+ Salt = Salt + SaltVals[
ord(Rand.read(1)[0]) % len(SaltVals
)];
Pass = crypt.crypt(Password,Salt);
if len(Pass) < 14:
raise "Password Error", "MD5 password hashing failed, not changing the password!";
Pass = crypt.crypt(Password,Salt);
if len(Pass) < 14:
raise "Password Error", "MD5 password hashing failed, not changing the password!";