summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2024-08-27 17:04:32 +0200
committerArne Schwabe <arne@rfc2549.org>2024-08-27 17:04:32 +0200
commite43df2308c209c019514594ba02b940ec3307a96 (patch)
tree92f8c875165ff9bbf374afb058ab9b67a40bc7e6
parentbbe496ba2bcbe6907ab59b64ff41fc5af5cb5123 (diff)
Do add trailing newline when send CR_TEXT response
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java2
-rw-r--r--main/src/ui/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java14
2 files changed, 8 insertions, 8 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
index a1411b5e..0ca3b167 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
@@ -218,7 +218,7 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac
@Override
public void challengeResponse(String response) throws RemoteException {
if (mManagement != null) {
- String b64response = Base64.encodeToString(response.getBytes(Charset.forName("UTF-8")), Base64.DEFAULT);
+ String b64response = Base64.encodeToString(response.getBytes(Charset.forName("UTF-8")), Base64.NO_WRAP);
mManagement.sendCRResponse(b64response);
}
}
diff --git a/main/src/ui/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java b/main/src/ui/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java
index b1bfcaf5..e4d6b32f 100644
--- a/main/src/ui/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java
+++ b/main/src/ui/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java
@@ -293,7 +293,7 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable
@Override
public void sendCRResponse(String response) {
mHandler.post(() -> {
- post_cc_msg("CR_RESPONSE," + response + "\n");
+ post_cc_msg("CR_RESPONSE," + response);
});
}
@@ -326,15 +326,15 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable
VpnStatus.updateStateString(name, "VPN connection paused", R.string.state_userpause, ConnectionStatus.LEVEL_VPNPAUSED);
case "RESUME" ->
VpnStatus.updateStateString(name, "VPN connection resumed", R.string.state_reconnecting, ConnectionStatus.LEVEL_CONNECTING_NO_SERVER_REPLY_YET);
- default -> VpnStatus.updateStateString(name, info);
+ default ->
+ {
+ VpnStatus.updateStateString(name, info);
+ VpnStatus.logInfo(String.format("EVENT: %s: %s", name, info));
+ }
}
- /* if (event.name.equals("DYNAMIC_CHALLENGE")) {
- ClientAPI_DynamicChallenge challenge = new ClientAPI_DynamicChallenge();
- final boolean status = ClientAPI_OpenVPNClient.parse_dynamic_challenge(event.info, challenge);
-
- } else */
if (event.getError())
VpnStatus.logError(String.format("EVENT(Error): %s: %s", name, info));
+
}
@Override