/offlineimap/head: changeset 282

Updated with more md5 debugging
This commit is contained in:
jgoerzen 2002-11-05 08:11:28 +01:00
parent 6b181da921
commit efb69df3f0

View File

@ -105,16 +105,22 @@ class IMAPServer:
self.semaphore.release() self.semaphore.release()
def md5handler(self, response): def md5handler(self, response):
ui = UIBase.getglobalui()
challenge = response.strip() challenge = response.strip()
ui.debug('imap', 'md5handler: got challenge %s' % challenge)
while len(challenge) < 64: while len(challenge) < 64:
challenge += "\0" challenge += "\0"
if len(challenge) > 64: if len(challenge) > 64:
challenge = md5.new(challenge).digest() challenge = md5.new(challenge).digest()
ui.debug('imap', 'md5handler: post-processed challenge is %s' % \
repr(challenge))
msg = self.getpassword() msg = self.getpassword()
reply = hmac.new(challenge, msg) reply = hmac.new(challenge, msg)
retval = self.username + ' ' + \ retval = self.username + ' ' + \
reply.hexdigest() reply.hexdigest()
ui.debug('imap', 'md5handler: returning %s' % retval)
return retval return retval
def plainauth(self, imapobj): def plainauth(self, imapobj):