summaryrefslogtreecommitdiff
path: root/src/se/leap/bitmaskclient/ProviderAPI.java
diff options
context:
space:
mode:
authorSean Leonard <meanderingcode@aetherislands.net>2013-11-15 11:59:25 -0800
committerSean Leonard <meanderingcode@aetherislands.net>2013-11-15 11:59:25 -0800
commitb1974082398959704f72734d4bc801fd041fd1b4 (patch)
treee1dc1be77a1b1bb897c30a9ed20db2c66f443eed /src/se/leap/bitmaskclient/ProviderAPI.java
parent178df1e8bd76866e6d7e7f623f41caf1893cf6f3 (diff)
parent97da9475ac740f3fb1f75c68995fe827fb917015 (diff)
Merge branch 'bug/srp-b-validation' into develop
Diffstat (limited to 'src/se/leap/bitmaskclient/ProviderAPI.java')
-rw-r--r--src/se/leap/bitmaskclient/ProviderAPI.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/se/leap/bitmaskclient/ProviderAPI.java b/src/se/leap/bitmaskclient/ProviderAPI.java
index 1408efc8..6ed3a294 100644
--- a/src/se/leap/bitmaskclient/ProviderAPI.java
+++ b/src/se/leap/bitmaskclient/ProviderAPI.java
@@ -259,6 +259,7 @@ public class ProviderAPI extends IntentService {
String salt = saltAndB.getString(LeapSRPSession.SALT);
byte[] Bbytes = new BigInteger(saltAndB.getString("B"), 16).toByteArray();
byte[] M1 = client.response(new BigInteger(salt, 16).toByteArray(), Bbytes);
+ if(M1 != null) {
JSONObject session_idAndM2 = sendM1ToSRPServer(authentication_server, username, M1);
if(session_idAndM2.has(LeapSRPSession.M2) && client.verify((byte[])session_idAndM2.get(LeapSRPSession.M2))) {
session_id_bundle.putBoolean(RESULT_KEY, true);
@@ -267,6 +268,11 @@ public class ProviderAPI extends IntentService {
session_id_bundle.putString(getResources().getString(R.string.user_message), getResources().getString(R.string.error_bad_user_password_user_message));
session_id_bundle.putString(LogInDialog.USERNAME, username);
}
+ } else {
+ session_id_bundle.putBoolean(RESULT_KEY, false);
+ session_id_bundle.putString(LogInDialog.USERNAME, username);
+ session_id_bundle.putString(getResources().getString(R.string.user_message), getResources().getString(R.string.error_srp_math_error_user_message));
+ }
} else {
session_id_bundle.putString(getResources().getString(R.string.user_message), getResources().getString(R.string.error_bad_user_password_user_message));
session_id_bundle.putString(LogInDialog.USERNAME, username);