/offlineimap/head: changeset 284
Working (and tested) CRAM-MD5 implementation.
This commit is contained in:
parent
32713cb0d1
commit
a2720a4d21
@ -108,18 +108,9 @@ class IMAPServer:
|
||||
ui = UIBase.getglobalui()
|
||||
challenge = response.strip()
|
||||
ui.debug('imap', 'md5handler: got challenge %s' % challenge)
|
||||
while len(challenge) < 64:
|
||||
challenge += "\0"
|
||||
|
||||
if len(challenge) > 64:
|
||||
challenge = md5.new(challenge).digest()
|
||||
|
||||
ui.debug('imap', 'md5handler: post-processed challenge is %s' % \
|
||||
repr(challenge))
|
||||
msg = self.getpassword()
|
||||
reply = hmac.new(challenge, msg)
|
||||
retval = self.username + ' ' + \
|
||||
reply.hexdigest()
|
||||
passwd = self.getpassword()
|
||||
retval = self.username + ' ' + hmac.new(passwd, challenge).hexdigest()
|
||||
ui.debug('imap', 'md5handler: returning %s' % retval)
|
||||
return retval
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user