diff options
Diffstat (limited to 'src/leap/base')
-rw-r--r-- | src/leap/base/auth.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/leap/base/auth.py b/src/leap/base/auth.py index 5a9ebe1d..cc9562d8 100644 --- a/src/leap/base/auth.py +++ b/src/leap/base/auth.py @@ -177,10 +177,16 @@ class SRPAuth(requests.auth.AuthBase): SERVER + '/sessions/' + self.username, data={'client_auth': binascii.hexlify(self.M)}) - # XXX check for errors auth_data = self.get_data(auth_result) + M2 = auth_data.get("M2", None) + if not M2: + errors = auth_data.get('errors', None) + if errors: + logger.error(errors) + raise SRPAuthenticationError('Authentication Error') + self.srp_usr.verify_session( - safe_unhexlify(auth_data["M2"])) + safe_unhexlify(M2)) try: assert self.srp_usr.authenticated() |