Override Mullvad password (#233)
Set "m" as per official documentation: https://mullvad.net/en/help/installing-mullvad-iphone-and-ipad/
This commit is contained in:
parent
c4ca510b72
commit
66a04862f9
|
@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
- Oeck provider is available again to free users.
|
- Oeck provider is available again to free users.
|
||||||
- Randomic crashes on profile updates. [#229](https://github.com/passepartoutvpn/passepartout-apple/pull/229)
|
- Randomic crashes on profile updates. [#229](https://github.com/passepartoutvpn/passepartout-apple/pull/229)
|
||||||
|
- Mullvad: enforce password to avoid "Auth failed". [#233](https://github.com/passepartoutvpn/passepartout-apple/pull/233)
|
||||||
|
|
||||||
## 2.0.0 (2022-10-02)
|
## 2.0.0 (2022-10-02)
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ import PassepartoutCore
|
||||||
import PassepartoutUtils
|
import PassepartoutUtils
|
||||||
|
|
||||||
extension ProfileManager {
|
extension ProfileManager {
|
||||||
public func savePassword(forProfile profile: Profile) {
|
public func savePassword(forProfile profile: Profile, newPassword: String? = nil) {
|
||||||
guard !profile.isPlaceholder else {
|
guard !profile.isPlaceholder else {
|
||||||
assertionFailure("Placeholder")
|
assertionFailure("Placeholder")
|
||||||
return
|
return
|
||||||
|
@ -37,7 +37,7 @@ extension ProfileManager {
|
||||||
guard let keychainEntry = profile.keychainEntry else {
|
guard let keychainEntry = profile.keychainEntry else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let password = profile.account.password
|
let password = newPassword ?? profile.account.password
|
||||||
guard !password.isEmpty else {
|
guard !password.isEmpty else {
|
||||||
keychain.removePassword(
|
keychain.removePassword(
|
||||||
for: keychainEntry,
|
for: keychainEntry,
|
||||||
|
|
|
@ -56,8 +56,20 @@ extension VPNManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// specific provider customizations
|
||||||
|
var newPassword: String?
|
||||||
|
if let providerName = profile.providerName {
|
||||||
|
switch providerName {
|
||||||
|
case .mullvad:
|
||||||
|
newPassword = "m"
|
||||||
|
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// IMPORTANT: must commit password to keychain (tunnel needs a password reference)
|
// IMPORTANT: must commit password to keychain (tunnel needs a password reference)
|
||||||
profileManager.savePassword(forProfile: profile)
|
profileManager.savePassword(forProfile: profile, newPassword: newPassword)
|
||||||
|
|
||||||
let parameters = VPNConfigurationParameters(
|
let parameters = VPNConfigurationParameters(
|
||||||
profile,
|
profile,
|
||||||
|
|
Loading…
Reference in New Issue