diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-05-29 15:20:32 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-05-29 15:20:32 -0300 |
commit | 1f3573503be0cf7d61fa80ea866b8bef4a57b111 (patch) | |
tree | ab93803d57673f3dce633472baf20dc353c00a44 /src/leap/crypto | |
parent | 7780685a8beb8fbba54d5c366905d9ece5569008 (diff) | |
parent | 884d0e0f4dbba34b6f6f5afe6e27390a7606a7fa (diff) |
Merge remote-tracking branch 'kali/feature/ci-ready' into develop
Diffstat (limited to 'src/leap/crypto')
-rw-r--r-- | src/leap/crypto/srpauth.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/leap/crypto/srpauth.py b/src/leap/crypto/srpauth.py index 2f3cbd1c..f1897e1d 100644 --- a/src/leap/crypto/srpauth.py +++ b/src/leap/crypto/srpauth.py @@ -22,6 +22,9 @@ import requests import srp import json +#this error is raised from requests +from simplejson.decoder import JSONDecodeError + from PySide import QtCore, QtGui from leap.common.check import leap_assert @@ -232,7 +235,10 @@ class SRPAuth(QtCore.QObject): raise SRPAuthenticationError(self.tr("Could not connect to " "the server")) - content, mtime = get_content(auth_result) + try: + content, mtime = get_content(auth_result) + except JSONDecodeError: + raise SRPAuthenticationError("Bad JSON content in auth result") if auth_result.status_code == 422: logger.error("[%s] Wrong password (HAMK): [%s]" % @@ -319,6 +325,7 @@ class SRPAuth(QtCore.QObject): self._authentication_preprocessing(username, password) salt, B = self._start_authentication(username, password) M2 = self._process_challenge(salt, B, username) + self._verify_session(M2) leap_assert(self.get_session_id(), "Something went wrong because" |