From a81ae28db34412c298ececc64319a9cf993c18f3 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Fri, 13 Sep 2013 15:53:41 -0300 Subject: Handle correctly a logout problem. Closes #3774. Also remove preferences button disable, we don't need that. --- src/leap/bitmask/crypto/srpauth.py | 1 + 1 file changed, 1 insertion(+) (limited to 'src/leap/bitmask/crypto/srpauth.py') diff --git a/src/leap/bitmask/crypto/srpauth.py b/src/leap/bitmask/crypto/srpauth.py index 41ce130a..776fb2cc 100644 --- a/src/leap/bitmask/crypto/srpauth.py +++ b/src/leap/bitmask/crypto/srpauth.py @@ -553,6 +553,7 @@ class SRPAuth(QtCore.QObject): except Exception as e: logger.warning("Something went wrong with the logout: %r" % (e,)) + raise else: self.set_session_id(None) self.set_uid(None) -- cgit v1.2.3 From 50cddfdc2a9624a84d624be93bcc01b9b81d39d8 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Mon, 16 Sep 2013 19:07:18 -0300 Subject: Use generic username/password message. --- src/leap/bitmask/crypto/srpauth.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/leap/bitmask/crypto/srpauth.py') diff --git a/src/leap/bitmask/crypto/srpauth.py b/src/leap/bitmask/crypto/srpauth.py index 776fb2cc..8477ea9e 100644 --- a/src/leap/bitmask/crypto/srpauth.py +++ b/src/leap/bitmask/crypto/srpauth.py @@ -171,6 +171,9 @@ class SRPAuth(QtCore.QObject): self._srp_user = None self._srp_a = None + # Error msg displayed if the username or the password is invalid + self._WRONG_USER_PASS = self.tr("Invalid username or password.") + # User credentials stored for password changing checks self._username = None self._password = None @@ -265,7 +268,7 @@ class SRPAuth(QtCore.QObject): "Status code = %r. Content: %r" % (init_session.status_code, content)) if init_session.status_code == 422: - raise SRPAuthUnknownUser(self.tr("Unknown user")) + raise SRPAuthUnknownUser(self._WRONG_USER_PASS) raise SRPAuthBadStatusCode(self.tr("There was a problem with" " authentication")) @@ -354,7 +357,7 @@ class SRPAuth(QtCore.QObject): "received: %s", (content,)) logger.error("[%s] Wrong password (HAMK): [%s]" % (auth_result.status_code, error)) - raise SRPAuthBadPassword(self.tr("Wrong password")) + raise SRPAuthBadPassword(self._WRONG_USER_PASS) if auth_result.status_code not in (200,): logger.error("No valid response (HAMK): " -- cgit v1.2.3 From de766834e4a0148d7ca8ededaf84194dc7a5fb44 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Thu, 19 Sep 2013 12:55:32 -0300 Subject: Username case problem at login. Closes #3857. --- src/leap/bitmask/crypto/srpauth.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/leap/bitmask/crypto/srpauth.py') diff --git a/src/leap/bitmask/crypto/srpauth.py b/src/leap/bitmask/crypto/srpauth.py index 776fb2cc..95dd168d 100644 --- a/src/leap/bitmask/crypto/srpauth.py +++ b/src/leap/bitmask/crypto/srpauth.py @@ -200,8 +200,6 @@ class SRPAuth(QtCore.QObject): """ logger.debug("Authentication preprocessing...") - username = username.lower() - self._srp_user = self._srp.User(username, password, self._hashfun, @@ -506,7 +504,7 @@ class SRPAuth(QtCore.QObject): leap_assert(self.get_session_id() is None, "Already logged in") # User credentials stored for password changing checks - self._username = username.lower() + self._username = username self._password = password d = threads.deferToThread(self._authentication_preprocessing, @@ -615,7 +613,7 @@ class SRPAuth(QtCore.QObject): :param password: password for this user :type password: str """ - + username = username.lower() d = self.__instance.authenticate(username, password) d.addCallback(self._gui_notify) d.addErrback(self._errback) -- cgit v1.2.3