summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2018-09-19 14:04:21 +0200
committerArne Schwabe <arne@rfc2549.org>2018-09-19 14:04:21 +0200
commitd77f0e7e6bee2cf907b26e88719fc4f58b24186c (patch)
tree7c0d07af9cf0fd2d15ac332e18d9784c19435a39
parent5b3dc16f936f5817d890399bb3150dc1d4a694a5 (diff)
Default to async for openvpn3. Fix a few bugs in extauthprovider
-rw-r--r--build.gradle2
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/ExtAuthHelper.java10
-rw-r--r--main/src/main/java/de/blinkt/openvpn/fragments/KeyChainSettingsFragment.java20
-rw-r--r--main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java2
4 files changed, 30 insertions, 4 deletions
diff --git a/build.gradle b/build.gradle
index 9d0ff8bd..edfee06e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -12,7 +12,7 @@ buildscript {
google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.1.3'
+ classpath 'com.android.tools.build:gradle:3.1.4'
}
}
diff --git a/main/src/main/java/de/blinkt/openvpn/core/ExtAuthHelper.java b/main/src/main/java/de/blinkt/openvpn/core/ExtAuthHelper.java
index d513d759..166bce12 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/ExtAuthHelper.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/ExtAuthHelper.java
@@ -47,6 +47,16 @@ public class ExtAuthHelper {
int selectedPos = -1;
+ if (extProviders.size() ==0)
+ {
+ selectedApp = "";
+ ExternalAuthProvider noauthprovider = new ExternalAuthProvider();
+ noauthprovider.label = "No external auth provider found";
+ noauthprovider.packageName = selectedApp;
+ noauthprovider.configurable = false;
+ extProviders.add(noauthprovider);
+ }
+
for (int i = 0; i < extProviders.size(); i++) {
if (extProviders.get(i).packageName.equals(selectedApp))
diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/KeyChainSettingsFragment.java b/main/src/main/java/de/blinkt/openvpn/fragments/KeyChainSettingsFragment.java
index d82807fb..16f0438d 100644
--- a/main/src/main/java/de/blinkt/openvpn/fragments/KeyChainSettingsFragment.java
+++ b/main/src/main/java/de/blinkt/openvpn/fragments/KeyChainSettingsFragment.java
@@ -18,11 +18,13 @@ import android.security.KeyChain;
import android.security.KeyChainException;
import android.text.TextUtils;
import android.view.View;
+import android.widget.AdapterView;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import de.blinkt.openvpn.R;
import de.blinkt.openvpn.VpnProfile;
+import de.blinkt.openvpn.api.ExternalCertificateProvider;
import de.blinkt.openvpn.core.ExtAuthHelper;
import de.blinkt.openvpn.core.X509Utils;
@@ -57,7 +59,7 @@ abstract class KeyChainSettingsFragment extends Settings_Fragment implements Vie
mAliasCertificate.setText("");
} else {
mAliasCertificate.setText("Querying certificate from external provider...");
- mExtAliasName.setText(mProfile.mAlias);
+ mExtAliasName.setText("");
setCertificate(true);
}
}
@@ -139,6 +141,20 @@ abstract class KeyChainSettingsFragment extends Settings_Fragment implements Vie
v.findViewById(R.id.configure_extauth_button).setOnClickListener(this);
mAliasCertificate = v.findViewById(R.id.alias_certificate);
mExtAuthSpinner = v.findViewById(R.id.extauth_spinner);
+ mExtAuthSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+ ExtAuthHelper.ExternalAuthProvider selectedProvider = (ExtAuthHelper.ExternalAuthProvider) parent.getItemAtPosition(position);
+ if (!selectedProvider.packageName.equals(mProfile.mExternalAuthenticator)) {
+ mProfile.mAlias = "";
+ }
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView<?> parent) {
+
+ }
+ });
mExtAliasName = v.findViewById(R.id.extauth_detail);
mAliasName = v.findViewById(R.id.aliasname);
if (mHandler == null) {
@@ -158,11 +174,11 @@ abstract class KeyChainSettingsFragment extends Settings_Fragment implements Vie
private void startExternalAuthConfig() {
ExtAuthHelper.ExternalAuthProvider eAuth = (ExtAuthHelper.ExternalAuthProvider) mExtAuthSpinner.getSelectedItem();
+ mProfile.mExternalAuthenticator = eAuth.packageName;
if (!eAuth.configurable) {
fetchExtCertificateMetaData();
return;
}
- mProfile.mExternalAuthenticator = eAuth.packageName;
Intent extauth = new Intent(ExtAuthHelper.ACTION_CERT_CONFIGURATION);
extauth.setPackage(eAuth.packageName);
extauth.putExtra(ExtAuthHelper.EXTRA_ALIAS, mProfile.mAlias);
diff --git a/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java b/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java
index d132f612..208608eb 100644
--- a/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java
+++ b/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java
@@ -201,7 +201,7 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable
config.setGuiVersion(mVp.getVersionEnvString(mService));
//config.setPlatformVersion(mVp.getPlatformVersionEnvString());
config.setExternalPkiAlias("extpki");
- config.setCompressionMode("yes");
+ config.setCompressionMode("async");
config.setInfo(true);
config.setAllowLocalLanAccess(mVp.mAllowLocalLAN);