summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJonathan <jonathan@mullvad.net>2023-03-27 12:08:23 +0200
committerJonathan <jonathan@mullvad.net>2023-03-30 10:01:35 +0200
commit73e912ea5df3dc5109eba3e1ce66871db7f763db (patch)
tree0a72b9de6c7f6d2b9f4a725a103ff6aa6ea24730
parentd630325c55920cb4c294812e40221fea7e6d7510 (diff)
downloadmullvadvpn-73e912ea5df3dc5109eba3e1ce66871db7f763db.tar.xz
mullvadvpn-73e912ea5df3dc5109eba3e1ce66871db7f763db.zip
Account manager now always rotates key if needed
Previously the account manager would not rotate the wireguard key unless any account manager command was given. This resulted in old keys not being rotated sometimes when not using the GUI. This fixes this by always starting a key rotation when the account manager starts.
-rw-r--r--CHANGELOG.md1
-rw-r--r--mullvad-daemon/src/device/mod.rs12
2 files changed, 7 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0a2cc74687..40d56e949f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -40,6 +40,7 @@ Line wrap the file at 100 chars. Th
### Fixed
- Fix location search in desktop app only searching for English location names.
+- Fix automatic WireGuard key rotation not being initialized correctly when not running the GUI.
#### Android
- Fix adaptive app icon which previously had a displaced nose and some other oddities.
diff --git a/mullvad-daemon/src/device/mod.rs b/mullvad-daemon/src/device/mod.rs
index b2b9976501..22a073738d 100644
--- a/mullvad-daemon/src/device/mod.rs
+++ b/mullvad-daemon/src/device/mod.rs
@@ -448,6 +448,12 @@ impl AccountManager {
let mut current_api_call = api::CurrentApiCall::new();
loop {
+ if current_api_call.is_idle() {
+ if let Some(timed_rotation) = self.spawn_timed_key_rotation() {
+ current_api_call.set_timed_rotation(Box::pin(timed_rotation))
+ }
+ }
+
futures::select! {
api_result = current_api_call => {
self.consume_api_result(api_result, &mut current_api_call).await;
@@ -523,12 +529,6 @@ impl AccountManager {
}
}
}
-
- if current_api_call.is_idle() {
- if let Some(timed_rotation) = self.spawn_timed_key_rotation() {
- current_api_call.set_timed_rotation(Box::pin(timed_rotation))
- }
- }
}
self.shutdown().await;
if let Some(tx) = shutdown_tx {