Skip to content

Commit

Permalink
fix(decryption rules): fixing path to multiple ssl certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
shinmog committed Feb 16, 2023
1 parent 0555fc1 commit fb075e7
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion poli/decryption/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ type entry_v5 struct {
type dType_v2 struct {
SslForwardProxy *string `xml:"ssl-forward-proxy"`
SshProxy *string `xml:"ssh-proxy"`
SslCertificates *util.MemberType `xml:"ssl-inbound-inspection"`
SslCertificates *util.MemberType `xml:"ssl-inbound-inspection>certificates"`
}

func (e *entry_v5) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
Expand Down
29 changes: 29 additions & 0 deletions poli/decryption/fw_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package decryption

import (
"reflect"
"strings"
"testing"

"github.com/PaloAltoNetworks/pango/testdata"
"github.com/PaloAltoNetworks/pango/version"
)

func TestFwNormalization(t *testing.T) {
Expand Down Expand Up @@ -33,3 +35,30 @@ func TestFwNormalization(t *testing.T) {
})
}
}

func TestNotPresent(t *testing.T) {
mc := &testdata.MockClient{}
ns := FirewallNamespace(mc)

mc.Version = version.Number{10, 2, 0, ""}
mc.AddResp("")

elm := Entry{
Name: "rule1",
Uuid: "uuid123",
GroupTag: "tag123",
Description: "blah",
DestinationHips: []string{"dst2", "dst1"},
LogFailedTlsHandshakes: true,
LogSetting: "my log setting",
}

err := ns.Set("vsys1", elm)
if err != nil {
t.Fatalf("Failed set: %s", err)
}

if strings.Contains(mc.Elm, "ssl-inbound-inspection") {
t.Fatalf("Contains ssl-inbound-inspection")
}
}

0 comments on commit fb075e7

Please sign in to comment.