From a34b7a56fb7f09c1fa5a64a74c5aed3ec782bdb9 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Mon, 17 Aug 2015 17:21:23 +0200 Subject: Fix crl-verify if the crl path has spaces in it. --- .../de/blinkt/openvpn/activities/ConfigConverter.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java b/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java index 1eaca6c5..f316eeaa 100644 --- a/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java +++ b/main/src/main/java/de/blinkt/openvpn/activities/ConfigConverter.java @@ -185,14 +185,6 @@ public class ConfigConverter extends Activity implements FileSelectCallback, Vie if (!TextUtils.isEmpty(mEmbeddedPwFile)) ConfigParser.useEmbbedUserAuth(mResult, mEmbeddedPwFile); - - // Only use crl on import if it is found - ConfigParser.removeCRLCustomOption(mResult); - if (!TextUtils.isEmpty(mCrlFileName)) { - // TODO: Convert this to a real config option that is parsed - mResult.mCustomConfigOptions += "\ncrl-verify " + mCrlFileName; - } - vpl.addProfile(mResult); vpl.saveProfile(this, mResult); vpl.saveProfileList(this); @@ -518,6 +510,15 @@ public class ConfigConverter extends Activity implements FileSelectCallback, Vie mEmbeddedPwFile = cp.getAuthUserPassFile(); mEmbeddedPwFile = embedFile(cp.getAuthUserPassFile(), Utils.FileType.USERPW_FILE, false); mCrlFileName = embedFile(cp.getCrlVerifyFile(), Utils.FileType.CRL_FILE, true); + + ConfigParser.removeCRLCustomOption(mResult); + if (!TextUtils.isEmpty(mCrlFileName)) { + // TODO: Convert this to a real config option that is parsed + ConfigParser.removeCRLCustomOption(mResult); + mResult.mCustomConfigOptions += "\ncrl-verify " + VpnProfile.openVpnEscape(mCrlFileName); + } else if (!TextUtils.isEmpty(cp.getCrlVerifyFile())) { + mResult.mCustomConfigOptions += "\n#crl-verify " + VpnProfile.openVpnEscape(cp.getCrlVerifyFile()); + } } @Override -- cgit v1.2.3