def test_crypting(self): """ Make sure that the password checker is using crypt properly. """ passwd = 's3cr3t5' crypted = '..1kBafUApE8U' self.assertEquals(util.generateCryptedPass(passwd), crypted) self.assertEquals(util.checkCryptPassword(passwd, crypted), True)
def test_crypting(self): """ Make sure that the password checker is using crypt properly. """ passwd = "s3cr3t5" crypted = "..1kBafUApE8U" self.assertEquals(util.generateCryptedPass(passwd), crypted) self.assertEquals(util.checkCryptPassword(passwd, crypted), True)
def requestAvatarId(self, credentials): """ The main credentials-checking logic. """ username = credentials.username userConfig = self.getUser(username) if not userConfig: return self.unauth('Unknown user') if util.checkCryptPassword(credentials.password, userConfig.password): return defer.succeed(credentials.username) else: return self.unauth('User/password not correct')
def checkPW(self, password): return util.checkCryptPassword(password, self.password)