-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PIA-1291: Make wireguard the default option
- Loading branch information
1 parent
0a2d002
commit 937b29e
Showing
11 changed files
with
168 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// IsIkev2SelectedWithDefaultSettings.swift | ||
// PIA VPN | ||
// | ||
// Created by Juan Docal on 2024-02-05. | ||
// Copyright © 2024 Private Internet Access Inc. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import PIALibrary | ||
|
||
class IsIkev2SelectedWithDefaultSettings { | ||
|
||
private let DEFAULT_IKEV2_ENCRYPTION = "aes-256-gcm" | ||
private let DEFAULT_IKEV2_HANDSHAKE = "sha256" | ||
private let DEFAULT_IKEV2_MTU = 0 | ||
|
||
private let preferences: Client.Preferences | ||
|
||
init(preferences: Client.Preferences) { | ||
self.preferences = preferences | ||
} | ||
|
||
func callAsFunction() -> Bool { | ||
return preferences.vpnType == IKEv2Profile.vpnType && | ||
preferences.ikeV2EncryptionAlgorithm.lowercased() == DEFAULT_IKEV2_ENCRYPTION && | ||
preferences.ikeV2IntegrityAlgorithm.lowercased() == DEFAULT_IKEV2_HANDSHAKE && | ||
preferences.ikeV2PacketSize == DEFAULT_IKEV2_MTU | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// WasWireguardMigrationPerformed.swift | ||
// PIA VPN | ||
// | ||
// Created by Juan Docal on 2024-02-05. | ||
// Copyright © 2024 Private Internet Access Inc. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import PIALibrary | ||
|
||
class IsWireguardMigrationPerformed { | ||
|
||
private let preferences: Client.Preferences | ||
|
||
init(preferences: Client.Preferences) { | ||
self.preferences = preferences | ||
} | ||
|
||
func callAsFunction() -> Bool { | ||
return preferences.wireguardMigrationPerformed | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// PerformWireguardMigration.swift | ||
// PIA VPN | ||
// | ||
// Created by Juan Docal on 2024-02-05. | ||
// Copyright © 2024 Private Internet Access Inc. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import PIALibrary | ||
|
||
class PerformWireguardMigration { | ||
|
||
private let preferences: Client.Preferences | ||
|
||
init(preferences: Client.Preferences) { | ||
self.preferences = preferences | ||
} | ||
|
||
func callAsFunction() { | ||
preferences.setVpnTypeToWireguard() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// SetWireguardMigrationPerformed.swift | ||
// PIA VPN | ||
// | ||
// Created by Juan Docal on 2024-02-05. | ||
// Copyright © 2024 Private Internet Access Inc. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import PIALibrary | ||
|
||
class SetWireguardMigrationPerformed { | ||
|
||
private let preferences: Client.Preferences | ||
|
||
init(preferences: Client.Preferences) { | ||
self.preferences = preferences | ||
} | ||
|
||
func callAsFunction() { | ||
preferences.wireguardMigrationPerformed = true | ||
} | ||
} |