Fix gosec bounds in the byte swizzle, drop the now-unused releaseCapture, and make the SSH and approval-reuse tests actually exercise their paths

This commit is contained in:
Viktor Liu
2026-09-22 21:03:30 +02:00
parent 65bb3ae4f5
commit 8f06a43d93
4 changed files with 17 additions and 16 deletions
@@ -101,6 +101,7 @@ func TestApplyResolvedRule_SSHSkipsSourcePeer(t *testing.T) {
}
rule := &nmdata.PolicyRule{
Protocol: string(PolicyRuleProtocolNetbirdSSH),
Action: string(PolicyTrafficActionAccept),
Bidirectional: bidirectional,
}
state := NewPeerConnResolveState()
@@ -153,6 +154,7 @@ func TestApplyResolvedRule_SSHEnablesDestinationPeer(t *testing.T) {
func TestApplyResolvedRule_LegacySSHSkipsSourcePeer(t *testing.T) {
rule := &nmdata.PolicyRule{
Protocol: string(PolicyRuleProtocolTCP),
Action: string(PolicyTrafficActionAccept),
Ports: []string{"22"},
Bidirectional: true,
}