Ticket #3648: credentials.py.patch

File credentials.py.patch, 888 bytes (added by cocteau, 11 years ago)

UsernameHashedPassword.checkPassword.patch

Line 
1*** /usr/lib64/python2.4/site-packages/twisted/cred/credentials.py      2009-01-21 11:09:21.000000000 +0900
2--- credentials.py      2009-02-09 11:04:22.000000000 +0900
3***************
4*** 393,404 ****
5  class UsernameHashedPassword:
6      implements(IUsernameHashedPassword)
7
8      def __init__(self, username, hashed):
9          self.username = username
10          self.hashed = hashed
11
12      def checkPassword(self, password):
13!         return self.hashed == password
14
15
16  class UsernamePassword:
17--- 393,406 ----
18  class UsernameHashedPassword:
19      implements(IUsernameHashedPassword)
20
21+     import crypt
22+
23      def __init__(self, username, hashed):
24          self.username = username
25          self.hashed = hashed
26
27      def checkPassword(self, password):
28!         return self.hashed == crypt.crypt(password, self.hashed)
29
30
31  class UsernamePassword: