diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-05-06 23:52:22 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-05-06 23:52:22 +0200 |
commit | ab9933e33e5e7b5066659b4c8911480a70f360f5 (patch) | |
tree | 48c8f08d3f2ce778a28f17f0abd25f5c75d67814 /src/de/blinkt/openvpn/VpnProfile.java | |
parent | 231395d4df16f42107c57211c76075aefcd66c75 (diff) |
All control of openvpn is now over the unix socket. JNI is only used for starting openvpn.
Fix configuration if no DNS information is available. (closes issue #7 hopefully)
Version 0.5.0
Diffstat (limited to 'src/de/blinkt/openvpn/VpnProfile.java')
-rw-r--r-- | src/de/blinkt/openvpn/VpnProfile.java | 65 |
1 files changed, 6 insertions, 59 deletions
diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java index 75f0235d..3cbac8d7 100644 --- a/src/de/blinkt/openvpn/VpnProfile.java +++ b/src/de/blinkt/openvpn/VpnProfile.java @@ -92,62 +92,6 @@ public class VpnProfile implements Serializable{ public String mVerb="1"; - - public int describeContents() { - return 0; - } - - // Not used - public void writeToParcel(Parcel out, int flags) { - out.writeInt(mAuthenticationType); - out.writeLong(mUuid.getMostSignificantBits()); - out.writeLong(mUuid.getLeastSignificantBits()); - out.writeString(mName); - out.writeString(mAlias); - out.writeString(mClientCertFilename); - out.writeString(mTLSAuthDirection); - out.writeString(mTLSAuthFilename); - out.writeString(mClientKeyFilename); - out.writeString(mCaFilename); - out.writeValue(mUseLzo); - out.writeString(mServerPort); - out.writeValue(mUseUdp); - out.writeString(mPKCS12Filename); - out.writeString(mPKCS12Password); - out.writeValue(mUseTLSAuth); - out.writeString(mServerName); - } - - private VpnProfile(Parcel in) { - mAuthenticationType = in.readInt(); - mUuid = new UUID(in.readLong(), in.readLong()); - mName = in.readString(); - mAlias = in.readString(); - mClientCertFilename = in.readString(); - mTLSAuthDirection = in.readString(); - mTLSAuthFilename = in.readString(); - mClientKeyFilename = in.readString(); - mCaFilename = in.readString(); - mUseLzo = (Boolean) in.readValue(null); - mServerPort = in.readString(); - mUseUdp = (Boolean) in.readValue(null); - mPKCS12Filename = in.readString(); - mPKCS12Password = in.readString(); - mUseTLSAuth = (Boolean) in.readValue(null); - mServerName = in.readString(); - } - - public static final Parcelable.Creator<VpnProfile> CREATOR - = new Parcelable.Creator<VpnProfile>() { - public VpnProfile createFromParcel(Parcel in) { - return new VpnProfile(in); - } - - public VpnProfile[] newArray(int size) { - return new VpnProfile[size]; - } - }; - public static String openVpnEscape(String unescape) { String escapedString = unescape.replace("\\", "\\\\"); escapedString = escapedString.replace("\"","\\\""); @@ -180,19 +124,22 @@ public class VpnProfile implements Serializable{ String cfg=""; - // Enable managment interface + // Enable managment interface + cfg += "# Enables connection to GUI\n"; cfg += "management "; cfg +=cacheDir.getAbsolutePath() + "/" + "mgmtsocket"; cfg += " unix\n"; cfg += "management-hold\n\n"; - /* only needed if client is compiled with P2MP Server support as early version - * accidently were */ cfg+="# /tmp does not exist on Android\n"; cfg+="tmp-dir "; cfg+=cacheDir.getAbsolutePath(); cfg+="\n\n"; + + cfg+="# Silences script security warning\n"; + cfg+="script-security 0\n\n"; + boolean useTLSClient = (mAuthenticationType != TYPE_STATICKEYS); |