/offlineimap/head: changeset 284

Working (and tested) CRAM-MD5 implementation.
This commit is contained in:
mj 2002-11-06 02:10:14 +01:00
parent 32713cb0d1
commit a2720a4d21
1 changed files with 2 additions and 11 deletions

View File

@ -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