summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-02-02 16:37:43 +0100
committerArne Schwabe <arne@rfc2549.org>2013-02-02 16:37:43 +0100
commitf00cd03f5aa1f8042b55ebee5050d297cef6bb8a (patch)
treed6366f6696889de81932df08bec243f06e547cf2 /src
parentdbd9cf8fadb8d2911a20ad4fd3ddb708a7b77dba (diff)
Add the --auth option to the auth/enc dialog
Diffstat (limited to 'src')
-rw-r--r--src/de/blinkt/openvpn/ConfigParser.java5
-rw-r--r--src/de/blinkt/openvpn/Settings_Authentication.java13
-rw-r--r--src/de/blinkt/openvpn/VpnProfile.java4
3 files changed, 21 insertions, 1 deletions
diff --git a/src/de/blinkt/openvpn/ConfigParser.java b/src/de/blinkt/openvpn/ConfigParser.java
index dc605bbc..99e7ec93 100644
--- a/src/de/blinkt/openvpn/ConfigParser.java
+++ b/src/de/blinkt/openvpn/ConfigParser.java
@@ -388,6 +388,11 @@ public class ConfigParser {
if(cipher!=null)
np.mCipher= cipher.get(1);
+ Vector<String> auth = getOption("auth", 1, 1);
+ if(auth!=null)
+ np.mAuth = auth.get(1);
+
+
Vector<String> ca = getOption("ca",1,1);
if(ca!=null){
np.mCaFilename = ca.get(1);
diff --git a/src/de/blinkt/openvpn/Settings_Authentication.java b/src/de/blinkt/openvpn/Settings_Authentication.java
index 6733ed0c..4e3f1e6f 100644
--- a/src/de/blinkt/openvpn/Settings_Authentication.java
+++ b/src/de/blinkt/openvpn/Settings_Authentication.java
@@ -23,6 +23,7 @@ public class Settings_Authentication extends OpenVpnPreferencesFragment implemen
private SwitchPreference mUseTLSAuth;
private EditTextPreference mCipher;
private String mTlsAuthFileData;
+ private EditTextPreference mAuth;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -46,6 +47,9 @@ public class Settings_Authentication extends OpenVpnPreferencesFragment implemen
mCipher =(EditTextPreference) findPreference("cipher");
mCipher.setOnPreferenceChangeListener(this);
+ mAuth =(EditTextPreference) findPreference("auth");
+ mAuth.setOnPreferenceChangeListener(this);
+
loadSettings();
}
@@ -64,6 +68,8 @@ public class Settings_Authentication extends OpenVpnPreferencesFragment implemen
mTLSAuthDirection.setValue(mProfile.mTLSAuthDirection);
mCipher.setText(mProfile.mCipher);
onPreferenceChange(mCipher, mProfile.mCipher);
+ mAuth.setText(mProfile.mAuth);
+ onPreferenceChange(mAuth, mProfile.mAuth);
}
@Override
@@ -85,6 +91,11 @@ public class Settings_Authentication extends OpenVpnPreferencesFragment implemen
else
mProfile.mCipher = mCipher.getText();
+ if(mAuth.getText()==null)
+ mProfile.mAuth = null;
+ else
+ mProfile.mAuth = mAuth.getText();
+
}
@@ -96,7 +107,7 @@ public class Settings_Authentication extends OpenVpnPreferencesFragment implemen
preference.setSummary(mProfile.mServerName);
else
preference.setSummary((String)newValue);
- } else if (preference == mCipher) {
+ } else if (preference == mCipher || preference == mAuth) {
preference.setSummary((CharSequence) newValue);
}
return true;
diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java
index 74f01a3b..6f21397e 100644
--- a/src/de/blinkt/openvpn/VpnProfile.java
+++ b/src/de/blinkt/openvpn/VpnProfile.java
@@ -106,6 +106,7 @@ public class VpnProfile implements Serializable{
public String mConnectRetryMax="5";
public String mConnectRetry="5";
public boolean mUserEditable=true;
+ public String mAuth="";
static final String MINIVPN = "miniopenvpn";
@@ -349,6 +350,9 @@ public class VpnProfile implements Serializable{
cfg += "cipher " + mCipher + "\n";
}
+ if(nonNull(mAuth)) {
+ cfg += "auth " + mAuth + "\n";
+ }
// Obscure Settings dialog
if(mUseRandomHostname)