summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-07-02 21:42:07 +0200
committerArne Schwabe <arne@rfc2549.org>2012-07-02 21:42:07 +0200
commit106b2ec64486b32008471a6c81e1f43111e4cf49 (patch)
tree2a6a23da5bd535c23b2289b8f70a0fedc3714116
parenta142f5a6ebeeaa6b4f8e8ac559b3ea08d0677bf1 (diff)
parentd18dfef96c176e0d48160daa610b8664dba81c68 (diff)
Merge
-rw-r--r--AndroidManifest.xml4
-rw-r--r--res/values-de/strings.xml2
-rw-r--r--src/de/blinkt/openvpn/ConfigConverter.java23
-rw-r--r--src/de/blinkt/openvpn/ConfigParser.java13
4 files changed, 30 insertions, 12 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index e601f11..d63b3b4 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -17,8 +17,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.blinkt.openvpn"
- android:versionCode="33"
- android:versionName="0.5.9b" >
+ android:versionCode="34"
+ android:versionName="0.5.10" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index f0be67e..7e6216d 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -180,5 +180,3 @@
<string name="mobile_info">Modell %1$s (%2$s) %3$s, Android API %4$d</string>
<string name="error_rsa_sign">Fehler beim Zugriff auf den Android Keystore %1$s: %2$s</string>
</resources>
-<!-- LocalWords: OpenVPN
--->
diff --git a/src/de/blinkt/openvpn/ConfigConverter.java b/src/de/blinkt/openvpn/ConfigConverter.java
index 3ccda05..71a17fa 100644
--- a/src/de/blinkt/openvpn/ConfigConverter.java
+++ b/src/de/blinkt/openvpn/ConfigConverter.java
@@ -123,7 +123,8 @@ public class ConfigConverter extends ListActivity {
continue;
// read the file inline
- String filedata = VpnProfile.INLINE_TAG;
+
+ String filedata = "";
byte[] buf =new byte[2048];
log(R.string.trying_to_read, possibleFile.getAbsolutePath());
@@ -153,10 +154,22 @@ public class ConfigConverter extends ListActivity {
// This where I would like to have a c++ style
// void embedFile(std::string & option)
- mResult.mCaFilename = embedFile(mResult.mCaFilename);
- mResult.mClientCertFilename = embedFile(mResult.mClientCertFilename);
- mResult.mClientKeyFilename = embedFile(mResult.mClientKeyFilename);
- mResult.mTLSAuthFilename = embedFile(mResult.mTLSAuthFilename);
+ mResult.mCaFilename = VpnProfile.INLINE_TAG + embedFile(mResult.mCaFilename);
+ mResult.mClientCertFilename = VpnProfile.INLINE_TAG + embedFile(mResult.mClientCertFilename);
+ mResult.mClientKeyFilename = VpnProfile.INLINE_TAG + embedFile(mResult.mClientKeyFilename);
+ mResult.mTLSAuthFilename = VpnProfile.INLINE_TAG + embedFile(mResult.mTLSAuthFilename);
+
+ if(mResult.mUsername != null){
+ String data =embedFile(mResult.mName);
+ mResult.mName=null;
+ if(data!=null) {
+ String[] parts = data.split("\n");
+ if(parts.length >= 2) {
+ mResult.mName=parts[0];
+ mResult.mPassword=parts[1];
+ }
+ }
+ }
}
diff --git a/src/de/blinkt/openvpn/ConfigParser.java b/src/de/blinkt/openvpn/ConfigParser.java
index 913fda2..b897f63 100644
--- a/src/de/blinkt/openvpn/ConfigParser.java
+++ b/src/de/blinkt/openvpn/ConfigParser.java
@@ -225,6 +225,7 @@ public class ConfigParser {
"persist-tun",
"persist-key",
"register-dns",
+ "route-delay",
"route-gateway",
"route-metric",
"route-method",
@@ -424,14 +425,20 @@ public class ConfigParser {
if(getOption("nobind", 0, 0) != null)
np.mNobind=true;
- if(getOption("auth-user-pass",0,1) != null) {
+ Vector<String> authuser = getOption("auth-user-pass",0,1);
+ if(authuser !=null){
+
if(noauthtypeset) {
np.mAuthenticationType=VpnProfile.TYPE_USERPASS;
} else if(np.mAuthenticationType==VpnProfile.TYPE_CERTIFICATES) {
np.mAuthenticationType=VpnProfile.TYPE_USERPASS_CERTIFICATES;
} else if(np.mAuthenticationType==VpnProfile.TYPE_KEYSTORE) {
np.mAuthenticationType=VpnProfile.TYPE_USERPASS_KEYSTORE;
- }
+ }
+ if(authuser.size()>1) {
+ np.mName=authuser.get(1);
+ }
+
}
@@ -494,7 +501,7 @@ public class ConfigParser {
if(optionline.size()< (minarg+1) || optionline.size() > maxarg+1) {
String err = String.format("Option %s has %d parameters, expected between %d and %d",
- option,args.size()-1,minarg,maxarg );
+ option,optionline.size()-1,minarg,maxarg );
throw new ConfigParseError(err);
}
options.remove(option);