Restrict trusted networks in ConnectionService

This commit is contained in:
Davide De Rosa 2021-02-02 17:56:04 +01:00
parent 280ce70965
commit d613c17ac9
1 changed files with 23 additions and 19 deletions

View File

@ -553,6 +553,8 @@ public class ConnectionService: Codable {
log.verbose(protocolConfiguration)
var rules: [NEOnDemandRule] = []
do {
try ProductManager.shared.verifyEligibleForTrustedNetworks()
#if os(iOS)
if profile.trustedNetworks.includesMobile {
let rule = policyRule(for: profile)
@ -573,6 +575,8 @@ public class ConnectionService: Codable {
rule.ssidMatch = reallyTrustedWifis
rules.append(rule)
}
} catch {
}
let connection = NEOnDemandRuleConnect()
connection.interfaceTypeMatch = .any
rules.append(connection)