diff options
Diffstat (limited to 'main/src')
3 files changed, 7 insertions, 5 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/api/AppRestrictions.java b/main/src/main/java/de/blinkt/openvpn/api/AppRestrictions.java index 06da238e..caa2de32 100644 --- a/main/src/main/java/de/blinkt/openvpn/api/AppRestrictions.java +++ b/main/src/main/java/de/blinkt/openvpn/api/AppRestrictions.java @@ -22,6 +22,7 @@ import de.blinkt.openvpn.core.VpnStatus; import java.io.IOException; import java.io.StringReader; import java.math.BigInteger; +import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.*; @@ -66,7 +67,7 @@ public class AppRestrictions { MessageDigest digest; try { digest = MessageDigest.getInstance("SHA1"); - byte[] utf8_bytes = config.getBytes(); + byte[] utf8_bytes = config.getBytes(StandardCharsets.UTF_8); digest.update(utf8_bytes, 0, utf8_bytes.length); return new BigInteger(1, digest.digest()).toString(16); } catch (NoSuchAlgorithmException e) { diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java index 51fc58eb..37eb34dd 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java +++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java @@ -15,6 +15,7 @@ import java.io.IOException; import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Date;
@@ -135,7 +136,7 @@ public class OpenVPNThread implements Runnable { InputStream in = mProcess.getInputStream();
OutputStream out = mProcess.getOutputStream();
- BufferedReader br = new BufferedReader(new InputStreamReader(in));
+ BufferedReader br = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8));
mOutputStream = out;
mStreamFuture.run();
diff --git a/main/src/ui/java/de/blinkt/openvpn/fragments/Utils.kt b/main/src/ui/java/de/blinkt/openvpn/fragments/Utils.kt index 8db487e7..55056424 100644 --- a/main/src/ui/java/de/blinkt/openvpn/fragments/Utils.kt +++ b/main/src/ui/java/de/blinkt/openvpn/fragments/Utils.kt @@ -306,12 +306,12 @@ object Utils { if ("insecure".equals(vp.mTlSCertProfile)) warnings.add("low security (TLS security profile 'insecure' selected)"); - var cipher= vp.mCipher?.toUpperCase(Locale.ROOT) - if (cipher.isNullOrEmpty()) + var cipher= vp.mCipher.uppercase(Locale.ROOT) + if (cipher.isEmpty()) cipher = "BF-CBC"; for (weakCipher in weakCiphers) { - if ((vp.mDataCiphers != null && vp.mDataCiphers.toUpperCase(Locale.ROOT) + if ((vp.mDataCiphers != null && vp.mDataCiphers.uppercase(Locale.ROOT) .contains(weakCipher)) || (vp.mCompatMode in 1..20399 && (cipher == weakCipher)) ) |