From c2da5268b91e61b94be368051c5e548800a28581 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 1 Dec 2023 13:19:03 +0100 Subject: [PATCH] Fix linter errors --- profile/config.go | 16 ---------------- profile/profile-layered.go | 16 ---------------- status/security_level.go | 8 ++++---- 3 files changed, 4 insertions(+), 36 deletions(-) diff --git a/profile/config.go b/profile/config.go index bdb4f131e..632e3869c 100644 --- a/profile/config.go +++ b/profile/config.go @@ -143,22 +143,6 @@ var ( // Setting "DNS Exit Node Rules" at order 148. ) -// A list of all security level settings. -var securityLevelSettings = []string{ - CfgOptionBlockScopeInternetKey, - CfgOptionBlockScopeLANKey, - CfgOptionBlockScopeLocalKey, - CfgOptionBlockP2PKey, - CfgOptionBlockInboundKey, - CfgOptionFilterSubDomainsKey, - CfgOptionFilterCNAMEKey, - CfgOptionRemoveOutOfScopeDNSKey, - CfgOptionRemoveBlockedDNSKey, - CfgOptionDomainHeuristicsKey, - CfgOptionPreventBypassingKey, - CfgOptionDisableAutoPermitKey, -} - var ( // SPNRulesQuickSettings are now generated automatically shorty after start. SPNRulesQuickSettings = []config.QuickSetting{ diff --git a/profile/profile-layered.go b/profile/profile-layered.go index 88aea1522..4b89abdaa 100644 --- a/profile/profile-layered.go +++ b/profile/profile-layered.go @@ -11,7 +11,6 @@ import ( "github.com/safing/portbase/runtime" "github.com/safing/portmaster/intel" "github.com/safing/portmaster/profile/endpoints" - "github.com/safing/portmaster/status" ) // LayeredProfile combines multiple Profiles. @@ -444,14 +443,6 @@ func (lp *LayeredProfile) MatchFilterLists(ctx context.Context, entity *intel.En return endpoints.NoMatch, nil } -func (lp *LayeredProfile) wrapSecurityLevelOption(configKey string, globalConfig config.IntOption) config.BoolOption { - activeAtLevels := lp.wrapIntOption(configKey, globalConfig) - - return func() bool { - return uint8(activeAtLevels())&status.SecurityLevelNormal > 0 - } -} - func (lp *LayeredProfile) wrapBoolOption(configKey string, globalConfig config.BoolOption) config.BoolOption { var revCnt uint64 = 0 var value bool @@ -561,10 +552,3 @@ func (lp *LayeredProfile) wrapStringOption(configKey string, globalConfig config return value } } - -func max(a, b uint8) uint8 { - if a > b { - return a - } - return b -} diff --git a/status/security_level.go b/status/security_level.go index c6ba27416..46641fc2f 100644 --- a/status/security_level.go +++ b/status/security_level.go @@ -53,8 +53,8 @@ const DisplayHintSecurityLevel string = "security level" // Security levels. const ( - // SecurityLevelOff uint8 = 0 - SecurityLevelNormal uint8 = 1 - // SecurityLevelHigh uint8 = 2 - // SecurityLevelExtreme uint8 = 4 + SecurityLevelOff uint8 = 0 + SecurityLevelNormal uint8 = 1 + SecurityLevelHigh uint8 = 2 + SecurityLevelExtreme uint8 = 4 )