summaryrefslogtreecommitdiffhomepage
path: root/ios
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2022-05-30 13:51:40 +0200
committerAndrej Mihajlov <and@mullvad.net>2022-05-30 15:00:07 +0200
commit01290fbb01050b24e3b49fc7ecc6db4a2fd93a06 (patch)
tree6d4c83af1d0b559f8bb94b1b44cf8191a4e34bd7 /ios
parent17413725818eda9405974fd1481219ffcc7534de (diff)
downloadmullvadvpn-01290fbb01050b24e3b49fc7ecc6db4a2fd93a06.tar.xz
mullvadvpn-01290fbb01050b24e3b49fc7ecc6db4a2fd93a06.zip
Stop key rotation if device is revoked
Diffstat (limited to 'ios')
-rw-r--r--ios/MullvadVPN/REST/RESTError.swift1
-rw-r--r--ios/MullvadVPN/TunnelManager/TunnelManager.swift5
2 files changed, 4 insertions, 2 deletions
diff --git a/ios/MullvadVPN/REST/RESTError.swift b/ios/MullvadVPN/REST/RESTError.swift
index 3b6f24c49a..e275a9ab34 100644
--- a/ios/MullvadVPN/REST/RESTError.swift
+++ b/ios/MullvadVPN/REST/RESTError.swift
@@ -73,6 +73,7 @@ extension REST {
static let publicKeyInUse = ServerResponseCode(rawValue: "PUBKEY_IN_USE")
static let maxDevicesReached = ServerResponseCode(rawValue: "MAX_DEVICES_REACHED")
static let invalidAccessToken = ServerResponseCode(rawValue: "INVALID_ACCESS_TOKEN")
+ static let deviceNotFound = ServerResponseCode(rawValue: "DEVICE_NOT_FOUND")
let rawValue: String
init(rawValue: String) {
diff --git a/ios/MullvadVPN/TunnelManager/TunnelManager.swift b/ios/MullvadVPN/TunnelManager/TunnelManager.swift
index 66e26f0488..71a7c3a4a9 100644
--- a/ios/MullvadVPN/TunnelManager/TunnelManager.swift
+++ b/ios/MullvadVPN/TunnelManager/TunnelManager.swift
@@ -954,8 +954,9 @@ extension TunnelManager {
return nil
case .rotateKey(.unhandledResponse(_, let serverErrorResponse))
- where serverErrorResponse?.code == .invalidAccount:
- // Do not retry if account was removed.
+ where serverErrorResponse?.code == .invalidAccount ||
+ serverErrorResponse?.code == .deviceNotFound:
+ // Do not retry if account or device were removed.
return nil
default: