summaryrefslogtreecommitdiff
path: root/app/src/debug/java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2014-11-22 11:55:22 +0100
committerParménides GV <parmegv@sdf.org>2014-11-22 11:55:22 +0100
commit859e35404d57277c0eedb612102ad7fd03b12cac (patch)
tree1db88428515f039d4b82e107af8b7d087452478f /app/src/debug/java
parentc0b871a7bb60b00b7e30a5c060fc94b650644353 (diff)
parent8b272e8db92051ef9824d8552f47a3207e365a5a (diff)
Merge branch 'develop' into release-0.8.0
Diffstat (limited to 'app/src/debug/java')
-rw-r--r--app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java b/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
index 804e4b27..52645631 100644
--- a/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
+++ b/app/src/debug/java/se/leap/bitmaskclient/ProviderAPI.java
@@ -161,7 +161,15 @@ public class ProviderAPI extends IntentService {
final ResultReceiver receiver = command.getParcelableExtra(RECEIVER_KEY);
String action = command.getAction();
Bundle parameters = command.getBundleExtra(PARAMETERS);
- setting_up_provider = true;
+ if(provider_api_url == null) {
+ try {
+ JSONObject provider_json = new JSONObject(preferences.getString(Provider.KEY, "no provider"));
+ provider_api_url = provider_json.getString(Provider.API_URL) + "/" + provider_json.getString(Provider.API_VERSION);
+ } catch (JSONException e) {
+ }
+ }
+
+ setting_up_provider = true;
if(action.equalsIgnoreCase(SET_UP_PROVIDER)) {
Bundle result = setUpProvider(parameters);
@@ -281,7 +289,7 @@ public class ProviderAPI extends IntentService {
LeapSRPSession client = new LeapSRPSession(username, password);
byte[] A = client.exponential();
-
+
JSONObject step_result = sendAToSRPServer(provider_api_url, username, new BigInteger(1, A).toString(16));
try {
String salt = step_result.getString(LeapSRPSession.SALT);
@@ -915,6 +923,7 @@ public class ProviderAPI extends IntentService {
boolean danger_on = preferences.getBoolean(ProviderItem.DANGER_ON, false);
+
String cert_string = downloadWithProviderCA(new_cert_string_url.toString(), danger_on);
if(cert_string.isEmpty() || ConfigHelper.checkErroneousDownload(cert_string))
@@ -931,7 +940,7 @@ public class ProviderAPI extends IntentService {
return false;
}
}
-
+
private boolean loadCertificate(String cert_string) {
try {
// API returns concatenated cert & key. Split them for OpenVPN options