Skip to content

Commit 4afa23e

Browse files
committed
add trustpolicy fuzzer
Signed-off-by: Adam Korczynski <[email protected]>
1 parent 7c20eba commit 4afa23e

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module github.com/notaryproject/notation-go
33
go 1.22.0
44

55
require (
6+
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6
67
github.com/go-ldap/ldap/v3 v3.4.8
78
github.com/notaryproject/notation-core-go v1.1.1-0.20240918011623-695ea0c1ad1f
89
github.com/notaryproject/notation-plugin-framework-go v1.0.0

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 h1:He8afgbRMd7mFxO99hRNu+6tazq8nFF9lIwo9JFroBk=
2+
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8=
13
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 h1:mFRzDkZVAjdal+s7s0MwaRv9igoPqLRdzOLzw/8Xvq8=
24
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU=
35
github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa h1:LHTHcTQiSGT7VVbI0o4wBRNQIgn917usHWOd6VAffYI=

verifier/trustpolicy/fuzz_test.go

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright The Notary Project Authors.
2+
// Licensed under the Apache License, Version 2.0 (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
//
6+
// http://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
14+
package trustpolicy
15+
16+
import (
17+
"testing"
18+
19+
fuzz "github.com/AdaLogics/go-fuzz-headers"
20+
)
21+
22+
func FuzzDocumentValidate(f *testing.F) {
23+
f.Fuzz(func(t *testing.T, documentData []byte) {
24+
ff := fuzz.NewConsumer(documentData)
25+
policyDoc := &Document{}
26+
ff.GenerateStruct(policyDoc)
27+
policyDoc.Validate()
28+
})
29+
}

0 commit comments

Comments
 (0)