summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/de/blinkt/openvpn/BasicSettings.java10
-rw-r--r--src/de/blinkt/openvpn/VpnProfile.java16
2 files changed, 22 insertions, 4 deletions
diff --git a/src/de/blinkt/openvpn/BasicSettings.java b/src/de/blinkt/openvpn/BasicSettings.java
index 7c39eb94..51a4c2bc 100644
--- a/src/de/blinkt/openvpn/BasicSettings.java
+++ b/src/de/blinkt/openvpn/BasicSettings.java
@@ -173,10 +173,12 @@ public class BasicSettings extends Fragment implements View.OnClickListener, OnI
mView.findViewById(R.id.certs).setVisibility(View.GONE);
mView.findViewById(R.id.statickeys).setVisibility(View.GONE);
mView.findViewById(R.id.keystore).setVisibility(View.GONE);
+ mView.findViewById(R.id.cacert).setVisibility(View.GONE);
switch(type) {
case VpnProfile.TYPE_CERTIFICATES:
mView.findViewById(R.id.certs).setVisibility(View.VISIBLE);
+ mView.findViewById(R.id.cacert).setVisibility(View.VISIBLE);
break;
case VpnProfile.TYPE_PKCS12:
mView.findViewById(R.id.pkcs12).setVisibility(View.VISIBLE);
@@ -190,6 +192,8 @@ public class BasicSettings extends Fragment implements View.OnClickListener, OnI
case VpnProfile.TYPE_USERPASS:
mView.findViewById(R.id.userpassword).setVisibility(View.VISIBLE);
+ mView.findViewById(R.id.cacert).setVisibility(View.VISIBLE);
+ break;
}
@@ -208,7 +212,9 @@ public class BasicSettings extends Fragment implements View.OnClickListener, OnI
mType.setSelection(mProfile.mAuthenticationType);
mpkcs12.setData(mProfile.mPKCS12Filename);
mPKCS12Password.setText(mProfile.mPKCS12Password);
-
+ mUserName.setText(mProfile.mUsername);
+ mPassword.setText(mProfile.mPassword);
+
setAlias();
}
@@ -229,6 +235,8 @@ public class BasicSettings extends Fragment implements View.OnClickListener, OnI
mProfile.mPKCS12Filename = mpkcs12.getData();
mProfile.mPKCS12Password = mPKCS12Password.getText().toString();
+ mProfile.mPassword = mPassword.getText().toString();
+ mProfile.mUsername = mUserName.getText().toString();
}
diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java
index 2df4ec39..201bc111 100644
--- a/src/de/blinkt/openvpn/VpnProfile.java
+++ b/src/de/blinkt/openvpn/VpnProfile.java
@@ -70,8 +70,8 @@ public class VpnProfile implements Serializable{
public boolean mCheckRemoteCN=false;
public boolean mExpectTLSCert=true;
public String mRemoteCN="";
- private String mPassword;
- private String mUsername;
+ public String mPassword="";
+ public String mUsername="";
public boolean mRoutenopull=false;
@@ -225,6 +225,13 @@ public class VpnProfile implements Serializable{
cfg+="\n";
cfg+="management-query-passwords\n";
break;
+ case VpnProfile.TYPE_USERPASS:
+ cfg+="ca " + mCaFilename + "\n";
+ cfg+="auth-user-pass\n";
+ cfg+="management-query-passwords\n";
+ break;
+
+
}
@@ -233,7 +240,10 @@ public class VpnProfile implements Serializable{
}
if(mUseTLSAuth) {
- cfg+="tls-auth ";
+ if(mAuthenticationType==TYPE_STATICKEYS)
+ cfg+="static ";
+ else
+ cfg+="tls-auth ";
cfg+=mTLSAuthFilename;
cfg+=" ";
cfg+= mTLSAuthDirection;