diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2019-02-01 13:47:27 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2019-02-01 13:47:27 +0100 |
| commit | 5eb1c48eb475b015945608977239394885070a01 (patch) | |
| tree | db36be8227e6af9a272644fa9514e3d2832bfcb8 | |
| parent | 4e8e2fe42bfadbc08cbac683f2627e24417b91c2 (diff) | |
| download | mullvadvpn-5eb1c48eb475b015945608977239394885070a01.tar.xz mullvadvpn-5eb1c48eb475b015945608977239394885070a01.zip | |
Rename security => firewall in documentation and logging
| -rw-r--r-- | talpid-core/src/dns/windows/system_state.rs | 9 | ||||
| -rw-r--r-- | talpid-core/src/firewall/mod.rs | 8 | ||||
| -rw-r--r-- | talpid-core/src/firewall/windows.rs | 2 | ||||
| -rw-r--r-- | talpid-core/src/tunnel_state_machine/blocked_state.rs | 2 | ||||
| -rw-r--r-- | talpid-core/src/tunnel_state_machine/connected_state.rs | 2 | ||||
| -rw-r--r-- | talpid-core/src/tunnel_state_machine/connecting_state.rs | 2 | ||||
| -rw-r--r-- | talpid-core/src/tunnel_state_machine/disconnected_state.rs | 4 | ||||
| -rw-r--r-- | talpid-types/src/tunnel.rs | 4 |
8 files changed, 16 insertions, 17 deletions
diff --git a/talpid-core/src/dns/windows/system_state.rs b/talpid-core/src/dns/windows/system_state.rs index f5e1d073dd..f2557e7cf7 100644 --- a/talpid-core/src/dns/windows/system_state.rs +++ b/talpid-core/src/dns/windows/system_state.rs @@ -8,7 +8,7 @@ use std::{ }; /// This struct is responsible for saving a binary blob to disk. The binary blob is intended to -/// store system state that should be resotred when the security policy is reset. +/// store system DNS settings that should be restored when the DNS settings are reset. pub struct SystemStateWriter { /// Full path to the system state backup file pub backup_path: Box<Path>, @@ -16,15 +16,15 @@ pub struct SystemStateWriter { impl SystemStateWriter { /// Creates a new SystemStateWriter which will use a file in the cache directory to store system - /// state that has to be restored. + /// DNS state that has to be restored. pub fn new<P: AsRef<Path>>(backup_path: P) -> Self { Self { backup_path: backup_path.as_ref().to_owned().into_boxed_path(), } } - /// Writes a binary blob representing the system state to the backup location before any - /// security policies are applied. + /// Writes a binary blob representing the system DNS settings to the backup location before any + /// DNS changes are applied. pub fn write_backup(&self, data: &[u8]) -> io::Result<()> { let mut backup_file = File::create(&self.backup_path)?; backup_file.write_all(data)?; @@ -41,7 +41,6 @@ impl SystemStateWriter { } } - /// Removes a previously created state backup if it exists. pub fn remove_backup(&self) -> io::Result<()> { match fs::remove_file(&self.backup_path) { diff --git a/talpid-core/src/firewall/mod.rs b/talpid-core/src/firewall/mod.rs index e932a8ea09..b7977bc2cd 100644 --- a/talpid-core/src/firewall/mod.rs +++ b/talpid-core/src/firewall/mod.rs @@ -111,7 +111,7 @@ impl fmt::Display for FirewallPolicy { } } -/// Manages network security of the computer/device. Can apply and enforce security policies +/// Manages network security of the computer/device. Can apply and enforce firewall policies /// by manipulating the OS firewall and DNS settings. pub struct Firewall { inner: imp::Firewall, @@ -128,14 +128,14 @@ impl Firewall { /// Applies and starts enforcing the given `FirewallPolicy` Makes sure it is being kept in place /// until this method is called again with another policy, or until `reset_policy` is called. pub fn apply_policy(&mut self, policy: FirewallPolicy) -> Result<(), Error> { - log::info!("Applying security policy: {}", policy); + log::info!("Applying firewall policy: {}", policy); self.inner.apply_policy(policy) } /// Resets/removes any currently enforced `FirewallPolicy`. Returns the system to the same state /// it had before any policy was applied through this `Firewall` instance. pub fn reset_policy(&mut self) -> Result<(), Error> { - log::info!("Resetting security policy"); + log::info!("Resetting firewall policy"); self.inner.reset_policy() } } @@ -151,7 +151,7 @@ trait FirewallT: Sized { /// Enable the given FirewallPolicy fn apply_policy(&mut self, policy: FirewallPolicy) -> ::std::result::Result<(), Self::Error>; - /// Revert the system network security state to what it was before this instance started + /// Revert the system firewall state to what it was before this instance started /// modifying the system. fn reset_policy(&mut self) -> ::std::result::Result<(), Self::Error>; } diff --git a/talpid-core/src/firewall/windows.rs b/talpid-core/src/firewall/windows.rs index 5fc0514d36..d77a9a3dbd 100644 --- a/talpid-core/src/firewall/windows.rs +++ b/talpid-core/src/firewall/windows.rs @@ -31,7 +31,7 @@ error_chain! { /// Failure to apply firewall _blocked_ policy ApplyingBlockedPolicy { - description("Failed to apply blocked security policy") + description("Failed to apply blocked firewall policy") } /// Failure to reset firewall policies diff --git a/talpid-core/src/tunnel_state_machine/blocked_state.rs b/talpid-core/src/tunnel_state_machine/blocked_state.rs index 6fc25654a7..3d63e543a2 100644 --- a/talpid-core/src/tunnel_state_machine/blocked_state.rs +++ b/talpid-core/src/tunnel_state_machine/blocked_state.rs @@ -22,7 +22,7 @@ impl BlockedState { match shared_values .security .apply_policy(policy) - .chain_err(|| "Failed to apply security policy for blocked state") + .chain_err(|| "Failed to apply firewall policy for blocked state") { Ok(()) => None, Err(error) => { diff --git a/talpid-core/src/tunnel_state_machine/connected_state.rs b/talpid-core/src/tunnel_state_machine/connected_state.rs index c6e575ce04..73751076e9 100644 --- a/talpid-core/src/tunnel_state_machine/connected_state.rs +++ b/talpid-core/src/tunnel_state_machine/connected_state.rs @@ -58,7 +58,7 @@ impl ConnectedState { shared_values .security .apply_policy(policy) - .chain_err(|| "Failed to apply security policy for connected state") + .chain_err(|| "Failed to apply firewall policy for connected state") } fn get_endpoint_from_params(&self) -> Endpoint { diff --git a/talpid-core/src/tunnel_state_machine/connecting_state.rs b/talpid-core/src/tunnel_state_machine/connecting_state.rs index b5b4cb10a4..5c34a240ee 100644 --- a/talpid-core/src/tunnel_state_machine/connecting_state.rs +++ b/talpid-core/src/tunnel_state_machine/connecting_state.rs @@ -78,7 +78,7 @@ impl ConnectingState { shared_values .security .apply_policy(policy) - .chain_err(|| "Failed to apply security policy for connecting state") + .chain_err(|| "Failed to apply firewall policy for connecting state") } fn start_tunnel( diff --git a/talpid-core/src/tunnel_state_machine/disconnected_state.rs b/talpid-core/src/tunnel_state_machine/disconnected_state.rs index 6a66be499f..9bda32f1b2 100644 --- a/talpid-core/src/tunnel_state_machine/disconnected_state.rs +++ b/talpid-core/src/tunnel_state_machine/disconnected_state.rs @@ -18,12 +18,12 @@ impl DisconnectedState { shared_values .security .apply_policy(policy) - .chain_err(|| "Failed to apply blocking security policy for disconnected state") + .chain_err(|| "Failed to apply blocking firewall policy for disconnected state") } else { shared_values .security .reset_policy() - .chain_err(|| "Failed to reset security policy") + .chain_err(|| "Failed to reset firewall policy") }; if let Err(error) = result { log::error!("{}", error.display_chain()); diff --git a/talpid-types/src/tunnel.rs b/talpid-types/src/tunnel.rs index 7c27c7c4a6..4f2e630c2d 100644 --- a/talpid-types/src/tunnel.rs +++ b/talpid-types/src/tunnel.rs @@ -46,7 +46,7 @@ pub enum BlockReason { AuthFailed(Option<String>), /// Failed to configure IPv6 because it's disabled in the platform. Ipv6Unavailable, - /// Failed to set security policy. + /// Failed to set firewall policy. SetFirewallPolicyError, /// Failed to set system DNS server. SetDnsError, @@ -75,7 +75,7 @@ impl fmt::Display for BlockReason { ); } Ipv6Unavailable => "Failed to configure IPv6 because it's disabled in the platform", - SetFirewallPolicyError => "Failed to set security policy", + SetFirewallPolicyError => "Failed to set firewall policy", SetDnsError => "Failed to set system DNS server", StartTunnelError => "Failed to start connection to remote server", NoMatchingRelay => "No relay server matches the current settings", |
