0
0
mirror of https://github.com/schwabe/ics-openvpn.git synced 2024-09-20 03:52:27 +02:00

Add log message for unsupported key encryption

This commit is contained in:
Arne Schwabe 2021-10-15 03:21:03 +02:00
parent 841eba8271
commit 12c2b2a9d7
3 changed files with 7 additions and 4 deletions

View File

@ -155,7 +155,7 @@ public class OpenVPNThread implements Runnable {
logLevel = Math.max(4, logLevel);
VpnStatus.logMessageOpenVPN(logStatus, logLevel, msg);
VpnStatus.checkWeakMD(msg);
VpnStatus.addExtraHints(msg);
} else {
VpnStatus.logInfo("P:" + logline);
}

View File

@ -474,10 +474,13 @@ public class VpnStatus {
}
public static void checkWeakMD(String msg) {
public static void addExtraHints(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.");
if ((msg.contains("digital envelope routines::unsupported")))
logError("The encryption method of your private keys/pkcs12 might be outdated and you probably need to enable " +
"the OpenSSL legacy provider to be able to use this profile.");
}
public static synchronized void updateByteCount(long in, long out) {

View File

@ -55,7 +55,7 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable
ClientAPI_Status status = connect();
if (status.getError()) {
VpnStatus.logError(String.format("connect() error: %s: %s", status.getStatus(), status.getMessage()));
VpnStatus.checkWeakMD(status.getMessage());
VpnStatus.addExtraHints(status.getMessage());
} else {
VpnStatus.updateStateString("NOPROCESS", "OpenVPN3 thread finished", R.string.state_noprocess, ConnectionStatus.LEVEL_NOTCONNECTED);
}
@ -306,7 +306,7 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable
logmsg = logmsg.substring(0, logmsg.length() - 1);
VpnStatus.logInfo(logmsg);
VpnStatus.checkWeakMD(logmsg);
VpnStatus.addExtraHints(logmsg);
}
@Override