summaryrefslogtreecommitdiff
path: root/main/src/main/java/de/blinkt/openvpn/core
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/main/java/de/blinkt/openvpn/core')
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java8
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java8
2 files changed, 8 insertions, 8 deletions
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 bb3b804d..8b3d4525 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNThread.java
@@ -135,7 +135,6 @@ public class OpenVPNThread implements Runnable {
mDumpPath = logline.substring(DUMP_PATH_STRING.length());
Matcher m = LOG_PATTERN.matcher(logline);
- int logerror = 0;
if (m.matches()) {
int flags = Integer.parseInt(m.group(3), 16);
String msg = m.group(4);
@@ -155,13 +154,8 @@ public class OpenVPNThread implements Runnable {
if (msg.startsWith("MANAGEMENT: CMD"))
logLevel = Math.max(4, logLevel);
- if ((msg.endsWith("md too weak") && msg.startsWith("OpenSSL: error")) || msg.contains("error:140AB18E"))
- logerror = 1;
-
VpnStatus.logMessageOpenVPN(logStatus, logLevel, msg);
- if (logerror==1)
- VpnStatus.logError("OpenSSL reported a certificate with a weak hash, please the in app FAQ about weak hashes");
-
+ VpnStatus.checkWeakMD(msg);
} else {
VpnStatus.logInfo("P:" + logline);
}
diff --git a/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java b/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java
index e325f8b7..04848f93 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/VpnStatus.java
@@ -469,11 +469,17 @@ public class VpnStatus {
}
public static void logMessageOpenVPN(LogLevel level, int ovpnlevel, String message) {
+ /* Check for the weak md whe we have a message from OpenVPN */
newLogItem(new LogItem(level, ovpnlevel, message));
-
}
+ public static void checkWeakMD(String msg) {
+ if ((msg.endsWith("md too weak") && msg.startsWith("OpenSSL: error")) || msg.contains("error:140AB18E")
+ || msg.contains("SSL_CA_MD_TOO_WEAK") || (msg.contains("ca md too weak")))
+ logError("OpenSSL reported a certificate with a weak hash, please see the in app FAQ about weak hashes.");
+ }
+
public static synchronized void updateByteCount(long in, long out) {
TrafficHistory.LastDiff diff = trafficHistory.add(in, out);