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:
Davide De Rosa 2022-10-15 16:44:48 +02:00 committed by GitHub
parent c4ca510b72
commit 66a04862f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 3 deletions

View File

@ -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.
- 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)

View File

@ -29,7 +29,7 @@ import PassepartoutCore
import PassepartoutUtils
extension ProfileManager {
public func savePassword(forProfile profile: Profile) {
public func savePassword(forProfile profile: Profile, newPassword: String? = nil) {
guard !profile.isPlaceholder else {
assertionFailure("Placeholder")
return
@ -37,7 +37,7 @@ extension ProfileManager {
guard let keychainEntry = profile.keychainEntry else {
return
}
let password = profile.account.password
let password = newPassword ?? profile.account.password
guard !password.isEmpty else {
keychain.removePassword(
for: keychainEntry,

View File

@ -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)
profileManager.savePassword(forProfile: profile)
profileManager.savePassword(forProfile: profile, newPassword: newPassword)
let parameters = VPNConfigurationParameters(
profile,