summaryrefslogtreecommitdiff
path: root/app/src/release/java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2014-11-04 18:53:12 +0100
committerParménides GV <parmegv@sdf.org>2014-11-04 18:53:12 +0100
commit69ee1167a0b2150fd4b9165e16b7c68d9a0100dd (patch)
tree1007656c2401d970d7e369c50272cd27ed14d203 /app/src/release/java
parent43ac5ff987c67d61564f7b09ebacfa040f2b53b5 (diff)
parenta137eccdde9349dc52b29fdadcb44cf317465c5a (diff)
Merge branch 'bug/Restart-connection-if-authentication-fails-#6229' into develop
Diffstat (limited to 'app/src/release/java')
-rw-r--r--app/src/release/java/se/leap/bitmaskclient/ProviderAPI.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/app/src/release/java/se/leap/bitmaskclient/ProviderAPI.java b/app/src/release/java/se/leap/bitmaskclient/ProviderAPI.java
index 189289ec..749457e4 100644
--- a/app/src/release/java/se/leap/bitmaskclient/ProviderAPI.java
+++ b/app/src/release/java/se/leap/bitmaskclient/ProviderAPI.java
@@ -95,7 +95,7 @@ public class ProviderAPI extends IntentService {
ERRORS = "errors",
UPDATE_PROGRESSBAR = "update_progressbar",
CURRENT_PROGRESS = "current_progress",
- TAG = "provider_api_tag"
+ TAG = ProviderAPI.class.getSimpleName();
;
final public static int
@@ -897,7 +897,6 @@ public class ProviderAPI extends IntentService {
private boolean updateVpnCertificate() {
getNewCert();
- preferences.edit().putInt(EIP.PARSED_SERIAL, 0).commit();
Intent updateEIP = new Intent(getApplicationContext(), EIP.class);
updateEIP.setAction(EIP.ACTION_UPDATE_EIP_SERVICE);
startService(updateEIP);
@@ -919,7 +918,6 @@ public class ProviderAPI extends IntentService {
URL new_cert_string_url = new URL(provider_main_url + "/" + provider_json.getString(Provider.API_VERSION) + "/" + EIP.CERTIFICATE);
String cert_string = downloadWithProviderCA(new_cert_string_url.toString());
-
if(!cert_string.isEmpty()) {
if(ConfigHelper.checkErroneousDownload(cert_string)) {
String reason_to_fail = provider_json.getString(ERRORS);
@@ -940,12 +938,12 @@ public class ProviderAPI extends IntentService {
}
}
try {
- RSAPrivateKey keyCert = ConfigHelper.parseRsaKeyFromString(keyString);
- keyString = Base64.encodeToString( keyCert.getEncoded(), Base64.DEFAULT );
+ RSAPrivateKey key = ConfigHelper.parseRsaKeyFromString(keyString);
+ keyString = Base64.encodeToString(key.getEncoded(), Base64.DEFAULT);
preferences.edit().putString(EIP.PRIVATE_KEY, "-----BEGIN RSA PRIVATE KEY-----\n"+keyString+"-----END RSA PRIVATE KEY-----").commit();
- X509Certificate certCert = ConfigHelper.parseX509CertificateFromString(certificateString);
- certificateString = Base64.encodeToString( certCert.getEncoded(), Base64.DEFAULT);
+ X509Certificate certificate = ConfigHelper.parseX509CertificateFromString(certificateString);
+ certificateString = Base64.encodeToString(certificate.getEncoded(), Base64.DEFAULT);
preferences.edit().putString(EIP.CERTIFICATE, "-----BEGIN CERTIFICATE-----\n"+certificateString+"-----END CERTIFICATE-----").commit();
preferences.edit().putString(EIP.DATE_FROM_CERTIFICATE, EIP.certificate_date_format.format(Calendar.getInstance().getTime())).commit();
return true;