diff options
Diffstat (limited to 'app/src/main/java/de/blinkt/openvpn/core')
-rw-r--r-- | app/src/main/java/de/blinkt/openvpn/core/ConfigParser.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/src/main/java/de/blinkt/openvpn/core/ConfigParser.java b/app/src/main/java/de/blinkt/openvpn/core/ConfigParser.java index c6240bd0..5b4ab361 100644 --- a/app/src/main/java/de/blinkt/openvpn/core/ConfigParser.java +++ b/app/src/main/java/de/blinkt/openvpn/core/ConfigParser.java @@ -537,10 +537,33 @@ public class ConfigParser { np.mUseLzo = Boolean.valueOf(useLzo.get(1)); } + Vector<String> ncp_ciphers = getOption("ncp-ciphers", 1, 1); + Vector<String> data_ciphers = getOption("data-ciphers", 1, 1); Vector<String> cipher = getOption("cipher", 1, 1); + if (cipher != null) np.mCipher = cipher.get(1); + if (data_ciphers == null) + { + data_ciphers = ncp_ciphers; + } + + /* The world is not yet ready to only use data-ciphers, add --cipher to data-ciphers + * for now on import */ + if (data_ciphers != null) + { + np.mDataCiphers = data_ciphers.get(1); + + if (!TextUtils.isEmpty(np.mCipher) && !np.mDataCiphers.contains(np.mCipher)) + { + np.mDataCiphers += ":" + np.mCipher; + } + } else if (!TextUtils.isEmpty(np.mCipher) && !np.mCipher.equals("AES-128-GCM") && !np.mCipher.equals("AES-256")) + { + np.mDataCiphers += "AES-256-GCM:AES-128-GCM:" + np.mCipher; + } + Vector<String> auth = getOption("auth", 1, 1); if (auth != null) np.mAuth = auth.get(1); |