Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 262881
Collapse All | Expand All

(-)Hellanzb/Growl.py (-3 / +9 lines)
Lines 7-13 Link Here
7
__contributors__ = "Ingmar J Stein (Growl Team)"
7
__contributors__ = "Ingmar J Stein (Growl Team)"
8
8
9
import struct
9
import struct
10
import md5
10
11
# The md5 module has been deprecated as of Python 2.6.
12
try:
13
    from hashlib import md5
14
except ImportError:
15
    from md5 import md5
16
11
from socket import AF_INET, SOCK_DGRAM, socket
17
from socket import AF_INET, SOCK_DGRAM, socket
12
18
13
GROWL_UDP_PORT=9887
19
GROWL_UDP_PORT=9887
Lines 51-57 Link Here
51
            self.data += encoded
57
            self.data += encoded
52
        for default in self.defaults:
58
        for default in self.defaults:
53
            self.data += struct.pack("B", default)
59
            self.data += struct.pack("B", default)
54
        self.checksum = md5.new()
60
        self.checksum = md5()
55
        self.checksum.update(self.data)
61
        self.checksum.update(self.data)
56
        if self.password:
62
        if self.password:
57
            self.checksum.update(self.password)
63
            self.checksum.update(self.password)
Lines 89-95 Link Here
89
        self.data += self.title
95
        self.data += self.title
90
        self.data += self.description
96
        self.data += self.description
91
        self.data += self.application
97
        self.data += self.application
92
        self.checksum = md5.new()
98
        self.checksum = md5()
93
        self.checksum.update(self.data)
99
        self.checksum.update(self.data)
94
        if password:
100
        if password:
95
            self.checksum.update(password)
101
            self.checksum.update(password)
(-)Hellanzb/Util.py (-3 lines)
Lines 28-36 Link Here
28
28
29
class FatalError(Exception):
29
class FatalError(Exception):
30
    """ An error that will cause the program to exit """
30
    """ An error that will cause the program to exit """
31
    def __init__(self, message):
32
        self.args = [message]
33
        self.message = message
34
31
35
class EmptyForThisPool(Empty):
32
class EmptyForThisPool(Empty):
36
    """ The queue is empty in terms of our current serverPool, but there are still segments to
33
    """ The queue is empty in terms of our current serverPool, but there are still segments to
(-)Hellanzb/HellaXMLRPC/HtPasswdAuth.py (-3 / +9 lines)
Lines 8-14 Link Here
8
(c) Copyright 2005 Philip Jenvey
8
(c) Copyright 2005 Philip Jenvey
9
[See end of file]
9
[See end of file]
10
"""
10
"""
11
import md5
11
12
# The md5 module has been deprecated as of Python 2.6.
13
try:
14
    from hashlib import md5
15
except ImportError:
16
    from md5 import md5
17
12
from twisted.web import static
18
from twisted.web import static
13
from twisted.web.resource import Resource
19
from twisted.web.resource import Resource
14
20
Lines 70-76 Link Here
70
        
76
        
71
        self.user = user
77
        self.user = user
72
        
78
        
73
        m = md5.new()
79
        m = md5()
74
        m.update(password)
80
        m.update(password)
75
        del password
81
        del password
76
        self.passwordDigest = m.digest()
82
        self.passwordDigest = m.digest()
Lines 90-96 Link Here
90
    def authenticateUser(self, request):
96
    def authenticateUser(self, request):
91
        username, password = request.getUser(), request.getPassword()
97
        username, password = request.getUser(), request.getPassword()
92
        
98
        
93
        m = md5.new()
99
        m = md5()
94
        m.update(password)
100
        m.update(password)
95
        
101
        
96
        authenticated = username == self.user and self.passwordDigest == m.digest()
102
        authenticated = username == self.user and self.passwordDigest == m.digest()

Return to bug 262881