summaryrefslogtreecommitdiff
path: root/src/leap/base
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-10-25 07:12:34 +0900
committerkali <kali@leap.se>2012-10-25 07:12:34 +0900
commita0fc20884a02ccffe1f9a83440b5e2212853289a (patch)
tree0bac297bc6a1b79a9662e3bd916479b691ba27f2 /src/leap/base
parent6de7d4ca4b018b00a02df27656cce536bb7c72e3 (diff)
login branch in wizard
Diffstat (limited to 'src/leap/base')
-rw-r--r--src/leap/base/auth.py10
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()