Merge pull request #1219 from mithodin/9733-mithodin-digestmod
Author: mithodin Reviewer: glyph Fixes: ticket:9733 CramMD5ClientAuthenticator now specifies the digestmod argument to hmac.HMAC constructor explicitly.
This commit is contained in:
commit
b4602e5e55
|
@ -8,6 +8,7 @@ Credential managers for L{twisted.mail}.
|
|||
from __future__ import absolute_import, division
|
||||
|
||||
import hmac
|
||||
import hashlib
|
||||
|
||||
from zope.interface import implementer
|
||||
|
||||
|
@ -28,8 +29,8 @@ class CramMD5ClientAuthenticator:
|
|||
|
||||
|
||||
def challengeResponse(self, secret, chal):
|
||||
response = hmac.HMAC(secret, chal).hexdigest().encode('ascii')
|
||||
return self.user + b' ' + response
|
||||
response = hmac.HMAC(secret, chal, digestmod=hashlib.md5).hexdigest()
|
||||
return self.user + b' ' + response.encode('ascii')
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue