diff options
author | Parménides GV <parmegv@ma.sdf.org> | 2013-06-24 19:37:35 +0200 |
---|---|---|
committer | Parménides GV <parmegv@ma.sdf.org> | 2013-06-24 19:37:35 +0200 |
commit | 50db5b5816476751f39bb7b8adc927562a0cc677 (patch) | |
tree | fa8fc602518430137895fbdbaba439f6c3d92321 /src/se/leap/openvpn/VpnProfile.java | |
parent | 195d5ab2d518f6f3960edd3c636e941830c2664d (diff) | |
parent | 304b29d6cb85d710756a56bc9c009429b8407d69 (diff) |
Merge branch 'feature/eip' into develop
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) |