From 104c48b6eb3d6c2a092fae4d50ddd54d0130609b Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Tue, 5 Nov 2013 14:10:33 -0300 Subject: Move string encoding to srpregister. --- src/leap/bitmask/crypto/srpregister.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/leap/bitmask/crypto') diff --git a/src/leap/bitmask/crypto/srpregister.py b/src/leap/bitmask/crypto/srpregister.py index 5c0a8efc..61f1899a 100644 --- a/src/leap/bitmask/crypto/srpregister.py +++ b/src/leap/bitmask/crypto/srpregister.py @@ -108,7 +108,8 @@ class SRPRegister(QtCore.QObject): :rparam: (ok, request) """ - username = username.lower() + username = username.lower().encode('utf-8') + password = password.encode('utf-8') salt, verifier = self._srp.create_salted_verification_key( username, -- cgit v1.2.3 From 5ae44d80876aa9c1e60280fbf437ee687d9bc3c8 Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Tue, 5 Nov 2013 14:59:30 -0300 Subject: Handle Timeout errors during register. Also catch all request exceptions to avoid failures. [Closes #4358] --- src/leap/bitmask/crypto/srpregister.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/leap/bitmask/crypto') diff --git a/src/leap/bitmask/crypto/srpregister.py b/src/leap/bitmask/crypto/srpregister.py index 61f1899a..e110df68 100644 --- a/src/leap/bitmask/crypto/srpregister.py +++ b/src/leap/bitmask/crypto/srpregister.py @@ -141,8 +141,7 @@ class SRPRegister(QtCore.QObject): verify=self._provider_config. get_ca_cert_path()) - except (requests.exceptions.SSLError, - requests.exceptions.ConnectionError) as exc: + except requests.exceptions.RequestExceptions as exc: logger.error(exc.message) ok = False else: -- cgit v1.2.3 From ac5c63a2636b1f764633283d18f04e0fc63a7b4f Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Tue, 5 Nov 2013 15:20:16 -0300 Subject: Fix typo --- src/leap/bitmask/crypto/srpregister.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/leap/bitmask/crypto') diff --git a/src/leap/bitmask/crypto/srpregister.py b/src/leap/bitmask/crypto/srpregister.py index e110df68..02a1ea63 100644 --- a/src/leap/bitmask/crypto/srpregister.py +++ b/src/leap/bitmask/crypto/srpregister.py @@ -141,7 +141,7 @@ class SRPRegister(QtCore.QObject): verify=self._provider_config. get_ca_cert_path()) - except requests.exceptions.RequestExceptions as exc: + except requests.exceptions.RequestException as exc: logger.error(exc.message) ok = False else: -- cgit v1.2.3 From 46a9bcbc1242aacad1947087c2d30c7952872d7b Mon Sep 17 00:00:00 2001 From: Ivan Alejandro Date: Thu, 14 Nov 2013 14:28:52 -0300 Subject: Set token to none in logout. --- src/leap/bitmask/crypto/srpauth.py | 1 + 1 file changed, 1 insertion(+) (limited to 'src/leap/bitmask/crypto') diff --git a/src/leap/bitmask/crypto/srpauth.py b/src/leap/bitmask/crypto/srpauth.py index ab98850d..85b9b003 100644 --- a/src/leap/bitmask/crypto/srpauth.py +++ b/src/leap/bitmask/crypto/srpauth.py @@ -581,6 +581,7 @@ class SRPAuth(QtCore.QObject): else: self.set_session_id(None) self.set_uid(None) + self.set_token(None) # Also reset the session self._session = self._fetcher.session() logger.debug("Successfully logged out.") -- cgit v1.2.3