diff options
author | Sean Leonard <meanderingcode@aetherislands.net> | 2013-07-26 15:30:24 -0600 |
---|---|---|
committer | Sean Leonard <meanderingcode@aetherislands.net> | 2013-07-26 15:30:24 -0600 |
commit | f49967fb3f24bf0a22d09b5823bd174a45e758f7 (patch) | |
tree | 7fefe9ec3aeff998c5dd99861428717a2c5f3a41 /src/se/leap/openvpn/VpnProfile.java | |
parent | 8dbb4517b07c42c3b37b0764d63973b5b1ed5ee6 (diff) | |
parent | b69c9a87f60e649221c8f83d58bbd57b35a64aca (diff) |
Merge branch 'release-0.2.0'0.2.0
Diffstat (limited to 'src/se/leap/openvpn/VpnProfile.java')
-rw-r--r-- | src/se/leap/openvpn/VpnProfile.java | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/se/leap/openvpn/VpnProfile.java b/src/se/leap/openvpn/VpnProfile.java index 38ee3c83..2262f565 100644 --- a/src/se/leap/openvpn/VpnProfile.java +++ b/src/se/leap/openvpn/VpnProfile.java @@ -20,6 +20,8 @@ import java.util.Vector; import org.spongycastle.util.io.pem.PemObject; import org.spongycastle.util.io.pem.PemWriter; + +import se.leap.leapclient.ConfigHelper; import se.leap.leapclient.R; import android.content.Context; @@ -62,7 +64,7 @@ public class VpnProfile implements Serializable{ // Public attributes, since I got mad with getter/setter // set members to default values private UUID mUuid; - public int mAuthenticationType = TYPE_KEYSTORE ; + public int mAuthenticationType = TYPE_CERTIFICATES ; public String mName; public String mAlias; public String mClientCertFilename; @@ -236,13 +238,18 @@ public class VpnProfile implements Serializable{ case VpnProfile.TYPE_USERPASS_CERTIFICATES: cfg+="auth-user-pass\n"; case VpnProfile.TYPE_CERTIFICATES: - // Ca + /*// Ca cfg+=insertFileData("ca",mCaFilename); // Client Cert + Key cfg+=insertFileData("key",mClientKeyFilename); cfg+=insertFileData("cert",mClientCertFilename); - +*/ + // FIXME This is all we need...The whole switch statement can go... + cfg+="<ca>\n"+ConfigHelper.getStringFromSharedPref(ConfigHelper.MAIN_CERT_KEY)+"\n</ca>\n"; + cfg+="<key>\n"+ConfigHelper.getStringFromSharedPref(ConfigHelper.KEY_KEY)+"\n</key>\n"; + cfg+="<cert>\n"+ConfigHelper.getStringFromSharedPref(ConfigHelper.CERT_KEY)+"\n</cert>\n"; + break; case VpnProfile.TYPE_USERPASS_PKCS12: cfg+="auth-user-pass\n"; @@ -492,8 +499,8 @@ public class VpnProfile implements Serializable{ Intent intent = new Intent(context,OpenVpnService.class); if(mAuthenticationType == VpnProfile.TYPE_KEYSTORE || mAuthenticationType == VpnProfile.TYPE_USERPASS_KEYSTORE) { - if(!saveCertificates(context)) - return null; + /*if(!saveCertificates(context)) + return null;*/ } intent.putExtra(prefix + ".ARGV" , buildOpenvpnArgv(context.getCacheDir())); @@ -597,10 +604,10 @@ public class VpnProfile implements Serializable{ //! Return an error if somethign is wrong public int checkProfile(Context context) { - if(mAuthenticationType==TYPE_KEYSTORE || mAuthenticationType==TYPE_USERPASS_KEYSTORE) { +/* if(mAuthenticationType==TYPE_KEYSTORE || mAuthenticationType==TYPE_USERPASS_KEYSTORE) { if(mAlias==null) return R.string.no_keystore_cert_selected; - } + }*/ if(!mUsePull) { if(mIPv4Address == null || cidrToIPAndNetmask(mIPv4Address) == null) |