OLD | NEW |
| (Empty) |
1 URL: http://twistedmatrix.com/trac/ | |
2 Version: 8.1.0 | |
3 License file: LICENSE | |
4 | |
5 | |
6 Local modifications: | |
7 | |
8 internet/_dumbwin32proc.py: | |
9 Edited _init__() to save the created process's PID. Edited kill() to run | |
10 taskkill on that PID rather than calling TerminateProcess(), so that steps' | |
11 children are also killed. Original version saved as _dumbwin32proc_orig.py. | |
12 | |
13 | |
14 | |
15 | |
16 Edit Twisted so it doesn't induce deprecated module warnings. | |
17 | |
18 diff -Nur twisted.unpatched/internet/_sslverify.py twisted/internet/_sslverify.p
y | |
19 --- twisted.unpatched/internet/_sslverify.py 2011-08-11 14:56:43.000000000 -0
700 | |
20 +++ twisted/internet/_sslverify.py 2011-08-11 14:56:59.000000000 -0700 | |
21 @@ -1,7 +1,8 @@ | |
22 # -*- test-case-name: twisted.test.test_sslverify -*- | |
23 # Copyright 2005 Divmod, Inc. See LICENSE file for details | |
24 | |
25 -import itertools, md5 | |
26 +import hashlib | |
27 +import itertools | |
28 from OpenSSL import SSL, crypto | |
29 | |
30 from twisted.python import reflect, util | |
31 @@ -666,7 +667,7 @@ | |
32 MD5 hex digest of signature on an empty certificate request with this | |
33 key. | |
34 """ | |
35 - return md5.md5(self._emptyReq).hexdigest() | |
36 + return hashlib.md5(self._emptyReq).hexdigest() | |
37 | |
38 | |
39 def inspect(self): | |
40 @@ -942,7 +943,7 @@ | |
41 ctx.set_options(self._OP_ALL) | |
42 | |
43 if self.enableSessions: | |
44 - sessionName = md5.md5("%s-%d" % (reflect.qual(self.__class__), _ses
sionCounter())).hexdigest() | |
45 + sessionName = hashlib.md5("%s-%d" % (reflect.qual(self.__class__),
_sessionCounter())).hexdigest() | |
46 ctx.set_session_id(sessionName) | |
47 | |
48 return ctx | |
49 diff -Nur twisted.unpatched/persisted/sob.py twisted/persisted/sob.py | |
50 --- twisted.unpatched/persisted/sob.py 2011-08-11 14:56:43.000000000 -0700 | |
51 +++ twisted/persisted/sob.py 2011-08-11 14:56:59.000000000 -0700 | |
52 @@ -9,7 +9,8 @@ | |
53 Maintainer: U{Moshe Zadka<mailto:moshez@twistedmatrix.com>} | |
54 """ | |
55 | |
56 -import os, md5, sys | |
57 +import hashlib | |
58 +import os, sys | |
59 try: | |
60 import cPickle as pickle | |
61 except ImportError: | |
62 @@ -31,11 +32,11 @@ | |
63 leftover = len(data) % cipher.block_size | |
64 if leftover: | |
65 data += ' '*(cipher.block_size - leftover) | |
66 - return cipher.new(md5.new(passphrase).digest()[:16]).encrypt(data) | |
67 + return cipher.new(hashlib.md5(passphrase).digest()[:16]).encrypt(data) | |
68 | |
69 def _decrypt(passphrase, data): | |
70 from Crypto.Cipher import AES | |
71 - return AES.new(md5.new(passphrase).digest()[:16]).decrypt(data) | |
72 + return AES.new(hashlib.md5(passphrase).digest()[:16]).decrypt(data) | |
73 | |
74 | |
75 class IPersistable(Interface): | |
76 diff -Nur twisted.unpatched/python/filepath.py twisted/python/filepath.py | |
77 --- twisted.unpatched/python/filepath.py 2011-08-11 14:56:43.000000000 -0
700 | |
78 +++ twisted/python/filepath.py 2011-08-11 14:56:59.000000000 -0700 | |
79 @@ -8,8 +8,8 @@ | |
80 | |
81 import os | |
82 import errno | |
83 +import hashlib | |
84 import random | |
85 -import sha | |
86 import base64 | |
87 | |
88 from os.path import isabs, exists, normpath, abspath, splitext | |
89 @@ -109,7 +109,7 @@ | |
90 """ | |
91 Create a pseudorandom, 16-character string for use in secure filenames. | |
92 """ | |
93 - return armor(sha.new(randomBytes(64)).digest())[:16] | |
94 + return armor(hashlib.sha1(randomBytes(64)).digest())[:16] | |
95 | |
96 class _PathHelper: | |
97 """ | |
98 diff -Nur twisted.unpatched/spread/pb.py twisted/spread/pb.py | |
99 --- twisted.unpatched/spread/pb.py 2011-08-11 14:56:43.000000000 -0700 | |
100 +++ twisted/spread/pb.py 2011-08-11 14:56:59.000000000 -0700 | |
101 @@ -61,7 +61,7 @@ | |
102 except ImportError: | |
103 import StringIO | |
104 | |
105 -import md5 | |
106 +import hashlib | |
107 import random | |
108 import new | |
109 import types | |
110 @@ -1007,10 +1007,10 @@ | |
111 | |
112 This is useful for challenge/response authentication. | |
113 """ | |
114 - m = md5.new() | |
115 + m = hashlib.md5() | |
116 m.update(password) | |
117 hashedPassword = m.digest() | |
118 - m = md5.new() | |
119 + m = hashlib.md5() | |
120 m.update(hashedPassword) | |
121 m.update(challenge) | |
122 doubleHashedPassword = m.digest() | |
123 @@ -1021,7 +1021,7 @@ | |
124 crap = '' | |
125 for x in range(random.randrange(15,25)): | |
126 crap = crap + chr(random.randint(65,90)) | |
127 - crap = md5.new(crap).digest() | |
128 + crap = hashlib.md5(crap).digest() | |
129 return crap | |
130 | |
131 | |
132 @@ -1337,12 +1337,12 @@ | |
133 | |
134 # IUsernameHashedPassword: | |
135 def checkPassword(self, password): | |
136 - return self.checkMD5Password(md5.md5(password).digest()) | |
137 + return self.checkMD5Password(hashlib.md5(password).digest()) | |
138 | |
139 | |
140 # IUsernameMD5Password | |
141 def checkMD5Password(self, md5Password): | |
142 - md = md5.new() | |
143 + md = hashlib.md5() | |
144 md.update(md5Password) | |
145 md.update(self.challenge) | |
146 correct = md.digest() | |
OLD | NEW |