summaryrefslogtreecommitdiffhomepage
path: root/talpid-core
diff options
context:
space:
mode:
Diffstat (limited to 'talpid-core')
-rw-r--r--talpid-core/src/tunnel/mod.rs7
-rw-r--r--talpid-core/src/tunnel_state_machine/connecting_state.rs4
2 files changed, 7 insertions, 4 deletions
diff --git a/talpid-core/src/tunnel/mod.rs b/talpid-core/src/tunnel/mod.rs
index a5d8c35f78..2c84f16596 100644
--- a/talpid-core/src/tunnel/mod.rs
+++ b/talpid-core/src/tunnel/mod.rs
@@ -80,7 +80,7 @@ error_chain!{
#[derive(Debug, Clone, Eq, PartialEq, Hash)]
pub enum TunnelEvent {
/// Sent when the tunnel fails to connect due to an authentication error.
- AuthFailed,
+ AuthFailed(Option<String>),
/// Sent when the tunnel comes up and is ready for traffic.
Up(TunnelMetadata),
/// Sent when the tunnel goes down.
@@ -106,7 +106,10 @@ impl TunnelEvent {
env: &HashMap<String, String>,
) -> Option<TunnelEvent> {
match *event {
- OpenVpnPluginEvent::AuthFailed => Some(TunnelEvent::AuthFailed),
+ OpenVpnPluginEvent::AuthFailed => {
+ let reason = env.get("auth_failed_reason").cloned();
+ Some(TunnelEvent::AuthFailed(reason))
+ }
OpenVpnPluginEvent::Up => {
let interface = env
.get("dev")
diff --git a/talpid-core/src/tunnel_state_machine/connecting_state.rs b/talpid-core/src/tunnel_state_machine/connecting_state.rs
index c41fca0b3b..228bc0c6fd 100644
--- a/talpid-core/src/tunnel_state_machine/connecting_state.rs
+++ b/talpid-core/src/tunnel_state_machine/connecting_state.rs
@@ -246,13 +246,13 @@ impl ConnectingState {
use self::EventConsequence::*;
match try_handle_event!(self, self.tunnel_events.poll()) {
- Ok(TunnelEvent::AuthFailed) => NewState(DisconnectingState::enter(
+ Ok(TunnelEvent::AuthFailed(reason)) => NewState(DisconnectingState::enter(
shared_values,
(
self.close_handle,
self.tunnel_close_event,
AfterDisconnect::Block(
- BlockReason::AuthFailed,
+ BlockReason::AuthFailed(reason),
self.tunnel_parameters.allow_lan,
),
),