# HG changeset patch # User Pascal Volk # Date 1219980505 0 # Node ID a3663ad491bfd1735c7a544eb9a5d84f3eca3dfd # Parent 0c124160a991c7c5fe3f0cb062e2f7f547eeea9a * 'VirtualMailManager/VirtualMailManager.py' - Fixed DIGEST-MD5 hash generation. diff -r 0c124160a991 -r a3663ad491bf VirtualMailManager/VirtualMailManager.py --- a/VirtualMailManager/VirtualMailManager.py Wed Aug 27 20:42:41 2008 +0000 +++ b/VirtualMailManager/VirtualMailManager.py Fri Aug 29 03:28:25 2008 +0000 @@ -391,8 +391,8 @@ elif self.__scheme == 'PLAIN-MD5': return _md5.hexdigest() elif self.__scheme == 'DIGEST-MD5' and emailaddress is not None: - _md5 = md5.new('%s:%s:' % tuple(emailaddress.split('@'))) - _md5.update(password) + # use an empty realm - works better with usenames like user@dom + _md5 = md5.new('%s::%s' % (emailaddress, password)) return _md5.hexdigest() def __pwMD4(self, password): @@ -635,11 +635,10 @@ def userPassword(self, emailaddress, password): acc = self.__getAccount(emailaddress) if acc.getUID() == 0: - raise VMMException(_(u"Account doesn't exists"), - ERR.NO_SUCH_ACCOUNT) + raise VMMException(_(u"Account doesn't exists"), ERR.NO_SUCH_ACCOUNT) if password is None: password = self._readpass() - acc.modify('password', self.__pwhash(password)) + acc.modify('password', self.__pwhash(password, user=emailaddress)) def userName(self, emailaddress, name): acc = self.__getAccount(emailaddress)