diff options
| author | Emīls <emils@mullvad.net> | 2020-10-06 11:12:56 +0100 |
|---|---|---|
| committer | Emīls <emils@mullvad.net> | 2020-10-12 12:21:39 +0100 |
| commit | b272330c201e560631a7441488223cbad2cf2d49 (patch) | |
| tree | b537dae11e24dc435ea4ec0a13df164878162f0a | |
| parent | 68079646e0b4fb65d8837d02fc6dfb3c3b461f94 (diff) | |
| download | mullvadvpn-b272330c201e560631a7441488223cbad2cf2d49.tar.xz mullvadvpn-b272330c201e560631a7441488223cbad2cf2d49.zip | |
Remove keys after resteting firewall
| -rw-r--r-- | CHANGELOG.md | 1 | ||||
| -rw-r--r-- | dist-assets/linux/before-remove.sh | 5 | ||||
| -rwxr-xr-x | dist-assets/uninstall_macos.sh | 3 | ||||
| -rw-r--r-- | dist-assets/windows/installer.nsh | 65 |
4 files changed, 47 insertions, 27 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 079f5d09be..71dedcf338 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ Line wrap the file at 100 chars. Th ### Changed - Use the API to fetch API IP addresses instead of DNS. +- Remove WireGuard keys during uninstallation after the firewall is unlocked. #### Android - Removed the Quit button. diff --git a/dist-assets/linux/before-remove.sh b/dist-assets/linux/before-remove.sh index 401419410b..0c2990b139 100644 --- a/dist-assets/linux/before-remove.sh +++ b/dist-assets/linux/before-remove.sh @@ -14,8 +14,6 @@ if [[ "$1" == "upgrade" ]]; then exit 0; fi -/usr/bin/mullvad account clear-history || echo "Failed to remove leftover WireGuard keys" - if which systemctl &> /dev/null; then # the user might've disabled or stopped the service themselves already systemctl stop mullvad-daemon.service || true @@ -25,4 +23,5 @@ elif /sbin/init --version | grep upstart &> /dev/null; then rm -f /etc/init/mullvad-daemon.conf fi -/opt/Mullvad\ VPN/resources/mullvad-setup reset-firewall || true +/opt/Mullvad\ VPN/resources/mullvad-setup reset-firewall || echo "Failed to reset firewall" +/opt/Mullvad\ VPN/resources/mullvad-setup clear-history || echo "Failed to remove leftover WireGuard keys" diff --git a/dist-assets/uninstall_macos.sh b/dist-assets/uninstall_macos.sh index 5beba32652..622457f994 100755 --- a/dist-assets/uninstall_macos.sh +++ b/dist-assets/uninstall_macos.sh @@ -13,8 +13,6 @@ fi echo "Stopping GUI process ..." sudo pkill -x "Mullvad VPN" || echo "No GUI process found" -mullvad account clear-history || echo "Failed to remove leftover WireGuard keys" - echo "Stopping and unloading mullvad-daemon system daemon ..." DAEMON_PLIST_PATH="/Library/LaunchDaemons/net.mullvad.daemon.plist" sudo launchctl unload -w "$DAEMON_PLIST_PATH" @@ -22,6 +20,7 @@ sudo rm -f "$DAEMON_PLIST_PATH" echo "Resetting firewall" sudo /Applications/Mullvad\ VPN.app/Contents/Resources/mullvad-setup reset-firewall +sudo /Applications/Mullvad\ VPN.app/Contents/Resources/mullvad-setup clear-history echo "Removing zsh shell completion symlink ..." sudo rm -f /usr/local/share/zsh/site-functions/_mullvad diff --git a/dist-assets/windows/installer.nsh b/dist-assets/windows/installer.nsh index e2536356e2..9294db690d 100644 --- a/dist-assets/windows/installer.nsh +++ b/dist-assets/windows/installer.nsh @@ -62,7 +62,7 @@ ${Else} File "${BUILD_RESOURCES_DIR}\binaries\x86_64-pc-windows-msvc\tap-driver\win7\*" ${EndIf} - + !macroend !define ExtractTapDriver '!insertmacro "ExtractTapDriver"' @@ -150,7 +150,7 @@ !macro InstallTapDriver log::Log "InstallTapDriver()" - + Push $0 Push $1 @@ -189,15 +189,15 @@ ${EndIf} log::Log "InstallTapDriver() completed successfully" - + Push 0 Pop $R0 - + InstallTapDriver_return: Pop $1 Pop $0 - + !macroend !define InstallTapDriver '!insertmacro "InstallTapDriver"' @@ -371,10 +371,10 @@ ${EndIf} log::Log "InstallService() completed successfully" - + Push 0 Pop $R0 - + InstallService_return: Pop $2 @@ -398,7 +398,7 @@ Push $1 tray::PromoteTrayIcon - + Pop $0 Pop $1 @@ -408,7 +408,7 @@ ${EndIf} log::Log "InstallTrayIcon() completed successfully" - + InstallTrayIcon_return: Pop $1 @@ -469,22 +469,22 @@ !macro RemoveRelayCache log::Log "RemoveRelayCache()" - + Push $0 Push $1 cleanup::RemoveRelayCache - + Pop $0 Pop $1 - + ${If} $0 != ${MULLVAD_SUCCESS} log::Log "Failed to remove relay cache: $1" Goto RemoveRelayCache_return ${EndIf} log::Log "RemoveRelayCache() completed successfully" - + RemoveRelayCache_return: Pop $1 @@ -589,6 +589,33 @@ !define ClearFirewallRules '!insertmacro "ClearFirewallRules"' # +# ClearAccountHistory +# +# Removes account history and any associated keys +# +!macro ClearAccountHistory + + Push $0 + Push $1 + + SetOutPath "$TEMP" + File "${BUILD_RESOURCES_DIR}\mullvad-setup.exe" + File "${BUILD_RESOURCES_DIR}\..\windows\winfw\bin\x64-Release\winfw.dll" + nsExec::ExecToStack '"$TEMP\mullvad-setup.exe" clear-history' + Pop $0 + Pop $1 + + log::Log "Remove account history: $0 $1" + + Pop $1 + Pop $0 + +!macroend + +!define ClearAccountHistory '!insertmacro "ClearAccountHistory"' + + +# # customInit # # This macro is activated right when the installer first starts up. @@ -655,7 +682,7 @@ log::Log "Running installer for ${PRODUCT_NAME} ${VERSION}" log::LogWindowsVersion - + # # The electron-builder NSIS logic, that runs before 'customInstall' is activated, # makes a copy of the installer file: @@ -667,7 +694,7 @@ RMDir /r "$LOCALAPPDATA\mullvad-vpn-updater" ${RemoveRelayCache} - + ${ExtractTapDriver} ${InstallTapDriver} @@ -771,13 +798,6 @@ nsExec::ExecToStack '"$TEMP\mullvad-setup.exe" prepare-restart' Pop $0 Pop $1 - ${Else} - # Remove keys - SetOutPath "$TEMP" - File "${BUILD_RESOURCES_DIR}\mullvad.exe" - nsExec::ExecToStack '"$TEMP\mullvad.exe" account clear-history' - Pop $0 - Pop $1 ${EndIf} nsExec::ExecToStack '"$SYSDIR\net.exe" stop mullvadvpn' @@ -803,6 +823,7 @@ # If not ran silently ${If} $FullUninstall == 1 ${ClearFirewallRules} + ${ClearAccountHistory} # Remove Wintun ${ExtractWintun} |
