diff options
author | Arne Schwabe <arne@rfc2549.org> | 2021-10-13 01:40:35 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2021-10-13 02:08:35 +0200 |
commit | cbb44807587e7e51acd3813099059a94448a6de4 (patch) | |
tree | 0d77ca95751bb22945425003af8e27d1ddf0bcf2 /main/src/main/java/de/blinkt/openvpn/VpnProfile.java | |
parent | c47793c19efe0e7bb71d4d119a213a0548c3b729 (diff) |
Fix warning with mCipher=nulll and add OpenVPN3 related warning
Diffstat (limited to 'main/src/main/java/de/blinkt/openvpn/VpnProfile.java')
-rw-r--r-- | main/src/main/java/de/blinkt/openvpn/VpnProfile.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java index 599647b0..115a9d03 100644 --- a/main/src/main/java/de/blinkt/openvpn/VpnProfile.java +++ b/main/src/main/java/de/blinkt/openvpn/VpnProfile.java @@ -867,8 +867,7 @@ public class VpnProfile implements Serializable, Cloneable { } private X509Certificate[] getKeyStoreCertificates(Context context) throws KeyChainException, InterruptedException { - PrivateKey privateKey = KeyChain.getPrivateKey(context, mAlias); - mPrivateKey = privateKey; + mPrivateKey = KeyChain.getPrivateKey(context, mAlias); X509Certificate[] caChain = KeyChain.getCertificateChain(context, mAlias); @@ -1059,6 +1058,22 @@ public class VpnProfile implements Serializable, Cloneable { } } + String dataciphers = ""; + if (!TextUtils.isEmpty(dataciphers)) + dataciphers = mDataCiphers.toUpperCase(Locale.ROOT); + + String cipher = "BF-CBC"; + if (!TextUtils.isEmpty(mCipher)) + cipher = mCipher.toUpperCase(Locale.ROOT); + + if (!mUseLegacyProvider && + (dataciphers.contains("BF-CBC") + || ((mCompatMode > 0 && mCompatMode < 20500) || useOpenVPN3) + && cipher.equals("BF-CBC"))) + { + return R.string.bf_cbc_requires_legacy; + } + // Everything okay return R.string.no_error_found; |