-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport TunnelSettingsV4 from quantum resistance exploratory branch
- Loading branch information
1 parent
e48c0ab
commit a4f88b9
Showing
5 changed files
with
76 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// QuantumResistanceSettings.swift | ||
// MullvadSettings | ||
// | ||
// Created by Andrew Bulhak on 2024-02-08. | ||
// Copyright © 2024 Mullvad VPN AB. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public enum TunnelQuantumResistance: Codable { | ||
case automatic | ||
case on | ||
case off | ||
} |
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,40 @@ | ||
// | ||
// TunnelSettingsV4.swift | ||
// MullvadSettings | ||
// | ||
// Created by Marco Nikic on 2024-02-06. | ||
// Copyright © 2024 Mullvad VPN AB. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import MullvadTypes | ||
|
||
public struct TunnelSettingsV4: Codable, Equatable, TunnelSettings { | ||
/// Relay constraints. | ||
public var relayConstraints: RelayConstraints | ||
|
||
/// DNS settings. | ||
public var dnsSettings: DNSSettings | ||
|
||
/// WireGuard obfuscation settings | ||
public var wireGuardObfuscation: WireGuardObfuscationSettings | ||
|
||
/// Whether Post Quantum exchanges are enabled. | ||
public var tunnelQuantumResistance: TunnelQuantumResistance | ||
|
||
public init( | ||
relayConstraints: RelayConstraints = RelayConstraints(), | ||
dnsSettings: DNSSettings = DNSSettings(), | ||
wireGuardObfuscation: WireGuardObfuscationSettings = WireGuardObfuscationSettings(), | ||
tunnelQuantumResistance: TunnelQuantumResistance = .automatic | ||
) { | ||
self.relayConstraints = relayConstraints | ||
self.dnsSettings = dnsSettings | ||
self.wireGuardObfuscation = wireGuardObfuscation | ||
self.tunnelQuantumResistance = tunnelQuantumResistance | ||
} | ||
|
||
public func upgradeToNextVersion() -> any TunnelSettings { | ||
self | ||
} | ||
} |
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