equal
deleted
inserted
replaced
1 from SecureAuthentificateXMLRPCServer import SecureAuthentificateXMLRPCRequestHandler |
1 from SecureAuthentificateXMLRPCServer import SecureAuthentificateXMLRPCRequestHandler |
2 from SecureXMLRPCServer import SecureXMLRPCServer |
2 from SecureXMLRPCServer import SecureXMLRPCServer |
3 import os, md5 |
3 import os, hashlib |
4 |
4 |
5 class UserDB: |
5 class UserDB: |
6 ''' |
6 ''' |
7 class for managing all xmlrpc users |
7 class for managing all xmlrpc users |
8 - each user is indyfied via a hash value, which is created out of the username + password |
8 - each user is indyfied via a hash value, which is created out of the username + password |
18 def createHash(self,user): |
18 def createHash(self,user): |
19 """ |
19 """ |
20 returns a hash out of username and the password and self.salt |
20 returns a hash out of username and the password and self.salt |
21 user is a directory with two keys: username and password |
21 user is a directory with two keys: username and password |
22 """ |
22 """ |
23 m=md5.new() |
23 m=hashlib.sha512() |
24 m.update(user["name"]) |
24 m.update(user["name"]) |
25 m.update(self.salt) |
25 m.update(self.salt) |
26 m.update(user["password"]) |
26 m.update(user["password"]) |
27 return m.hexdigest() |
27 return m.hexdigest() |
28 |
28 |