summaryrefslogtreecommitdiffhomepage
path: root/mullvad-daemon/src
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 /mullvad-daemon/src
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.
Diffstat (limited to 'mullvad-daemon/src')
-rw-r--r--mullvad-daemon/src/device/mod.rs12
1 files changed, 6 insertions, 6 deletions
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 {