mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
In stdlib, use hashlib instead of deprecated md5 and sha modules.
This commit is contained in:
parent
fa42bd7af4
commit
bffb0bc064
6 changed files with 16 additions and 17 deletions
|
|
@ -295,8 +295,8 @@ class POP3:
|
|||
m = self.timestamp.match(self.welcome)
|
||||
if not m:
|
||||
raise error_proto('-ERR APOP not supported by server')
|
||||
import md5
|
||||
digest = md5.new(m.group(1)+secret).digest()
|
||||
import hashlib
|
||||
digest = hashlib.md5(m.group(1)+secret).digest()
|
||||
digest = ''.join(map(lambda x:'%02x'%ord(x), digest))
|
||||
return self._shortcmd('APOP %s %s' % (user, digest))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue