summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2013-09-19 15:51:41 -0400
committerKali Kaneko <kali@leap.se>2013-09-19 15:51:41 -0400
commite9fa473865c84deb20ebf550f9cdc34c253a8cc2 (patch)
treee8955967671b7e418e142bbbd4ba1e1eb4bbb62d
parent1c194fe4b5d7b43097c31331cc8a7162bfbef4be (diff)
parent50cddfdc2a9624a84d624be93bcc01b9b81d39d8 (diff)
Merge remote-tracking branch 'ivan-github/bug/3656_generic-username-password-message' into develop
-rw-r--r--changes/bug-3656_generic-username-password-message2
-rw-r--r--src/leap/bitmask/crypto/srpauth.py7
2 files changed, 7 insertions, 2 deletions
diff --git a/changes/bug-3656_generic-username-password-message b/changes/bug-3656_generic-username-password-message
new file mode 100644
index 00000000..8e6e3e2f
--- /dev/null
+++ b/changes/bug-3656_generic-username-password-message
@@ -0,0 +1,2 @@
+ o Use generic bad username/password message instead of specific ones when
+ the user uses incorrect data during login. Closes #3656.
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): "