diff --git a/offlineimap/head/offlineimap/imapserver.py b/offlineimap/head/offlineimap/imapserver.py index 9981faf..bc254cb 100644 --- a/offlineimap/head/offlineimap/imapserver.py +++ b/offlineimap/head/offlineimap/imapserver.py @@ -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