summaryrefslogtreecommitdiff
path: root/app/src/production/java
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2017-09-21 01:28:24 +0200
committercyBerta <cyberta@riseup.net>2017-09-21 01:28:24 +0200
commitd77b9aefea75491b50f28a6880906ba9496979f2 (patch)
tree669cd96c72836c66caee662b4224e35df205d8a0 /app/src/production/java
parent63a604651b9fdc24a0e18c7b95a00e9fe6bb157d (diff)
update ics-openvpn: update classes, manifest, resources and build script
Diffstat (limited to 'app/src/production/java')
-rw-r--r--app/src/production/java/se/leap/bitmaskclient/ProviderAPI.java78
1 files changed, 58 insertions, 20 deletions
diff --git a/app/src/production/java/se/leap/bitmaskclient/ProviderAPI.java b/app/src/production/java/se/leap/bitmaskclient/ProviderAPI.java
index b9b449f0..ff6c0d41 100644
--- a/app/src/production/java/se/leap/bitmaskclient/ProviderAPI.java
+++ b/app/src/production/java/se/leap/bitmaskclient/ProviderAPI.java
@@ -16,26 +16,63 @@
*/
package se.leap.bitmaskclient;
-import android.app.*;
-import android.content.*;
-import android.content.res.*;
-import android.os.*;
-import android.util.*;
-
-import java.io.*;
-import java.math.*;
-import java.net.*;
-import java.security.*;
-import java.security.cert.*;
-import java.security.interfaces.*;
-import java.util.*;
-
-import javax.net.ssl.*;
-
-import org.json.*;
-import org.thoughtcrime.ssl.pinning.util.*;
-
-import se.leap.bitmaskclient.eip.*;
+import android.app.IntentService;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.res.Resources;
+import android.os.Bundle;
+import android.os.ResultReceiver;
+import android.util.Base64;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+import org.thoughtcrime.ssl.pinning.util.PinningHelper;
+
+import java.io.DataOutputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.math.BigInteger;
+import java.net.ConnectException;
+import java.net.CookieHandler;
+import java.net.CookieManager;
+import java.net.CookiePolicy;
+import java.net.MalformedURLException;
+import java.net.SocketTimeoutException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+import java.net.UnknownHostException;
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.cert.CertificateEncodingException;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.security.interfaces.RSAPrivateKey;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Scanner;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLHandshakeException;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+import javax.net.ssl.X509TrustManager;
+
+import se.leap.bitmaskclient.eip.Constants;
+import se.leap.bitmaskclient.eip.EIP;
import se.leap.bitmaskclient.userstatus.SessionDialog;
import se.leap.bitmaskclient.userstatus.User;
import se.leap.bitmaskclient.userstatus.UserStatus;
@@ -952,6 +989,7 @@ public class ProviderAPI extends IntentService {
}
}
+ //FIXME: don't save private keys in shared preferences! use the keystore
private boolean loadCertificate(String cert_string) {
try {
// API returns concatenated cert & key. Split them for OpenVPN options