diff options
author | Arne Schwabe <arne@rfc2549.org> | 2018-05-30 11:40:37 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2018-05-30 13:11:24 +0200 |
commit | b47948804f846d68c1dbc39ad4691bf0941cb825 (patch) | |
tree | 63f09b3896ce8a82bacc14fb7ef8f4db2f4b0435 /main/src/ovpn3 | |
parent | 82400795bdbc60bdb9d3d4ae300b46de0897a055 (diff) |
Implement showing an out of band authentication via URL to the user
Diffstat (limited to 'main/src/ovpn3')
-rw-r--r-- | main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java b/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java index b2e8714f..08c84558 100644 --- a/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java +++ b/main/src/ovpn3/java/de/blinkt/openvpn/core/OpenVPNThreadv3.java @@ -1,5 +1,6 @@ package de.blinkt.openvpn.core; +import de.blinkt.openvpn.R; import net.openvpn.ovpn3.ClientAPI_Config; import net.openvpn.ovpn3.ClientAPI_EvalConfig; import net.openvpn.ovpn3.ClientAPI_Event; @@ -189,6 +190,7 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable //config.setPlatformVersion(mVp.getPlatformVersionEnvString()); config.setExternalPkiAlias("extpki"); config.setCompressionMode("yes"); + config.setInfo(true); ClientAPI_EvalConfig ec = eval_config(config); if(ec.getExternalPki()) { @@ -278,9 +280,19 @@ public class OpenVPNThreadv3 extends ClientAPI_OpenVPNClient implements Runnable @Override public void event(ClientAPI_Event event) { - VpnStatus.updateStateString(event.getName(), event.getInfo()); + String name = event.getName(); + String info = event.getInfo(); + if (name.equals("INFO")) { + VpnStatus.logInfo(R.string.info_from_server, info); + if (info.startsWith("OPEN_URL:")) + { + mService.trigger_url_open(info); + } + } else{ + VpnStatus.updateStateString(name, info); + } if(event.getError()) - VpnStatus.logError(String.format("EVENT(Error): %s: %s",event.getName(),event.getInfo())); + VpnStatus.logError(String.format("EVENT(Error): %s: %s", name, info)); } |