diff options
| author | Emīls <emils@mullvad.net> | 2020-02-20 11:52:35 +0000 |
|---|---|---|
| committer | Emīls <emils@mullvad.net> | 2020-02-20 12:41:53 +0000 |
| commit | 5023742e64eeff7024258d584c29e9245d607640 (patch) | |
| tree | 62b877d72d554959d5629f0a2fbb3431723ad5d6 | |
| parent | 6d12bb8de7c54da08e256beade682e6622ae15d2 (diff) | |
| download | mullvadvpn-5023742e64eeff7024258d584c29e9245d607640.tar.xz mullvadvpn-5023742e64eeff7024258d584c29e9245d607640.zip | |
Fix key rotation behavior
| -rw-r--r-- | mullvad-daemon/src/wireguard.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mullvad-daemon/src/wireguard.rs b/mullvad-daemon/src/wireguard.rs index 4a56c1e900..f91a02a977 100644 --- a/mullvad-daemon/src/wireguard.rs +++ b/mullvad-daemon/src/wireguard.rs @@ -342,6 +342,7 @@ impl KeyManager { tokio_timer::wheel() .build() .interval(AUTOMATIC_ROTATION_RETRY_DELAY) + .map_err(Error::RotationScheduleError) .fold(public_key, move |old_public_key, _| { let fut = Self::next_automatic_rotation( daemon_tx.clone(), @@ -352,7 +353,10 @@ impl KeyManager { ); fut.then(|result| match result { Ok(new_public_key) => Ok(new_public_key), - Err(Error::TooManyKeys) => Ok(old_public_key), + Err(Error::TooManyKeys) => { + log::error!("Account has too many keys, stopping automatic rotation"); + Err(Error::TooManyKeys) + } Err(e) => { log::error!( "Key rotation failed: {}. Retrying in {} seconds", |
