...

Source file src/github.com/linkerd/linkerd2/pkg/identity/identity_fuzzer.go

Documentation: github.com/linkerd/linkerd2/pkg/identity

     1  package identity
     2  
     3  import (
     4  	"context"
     5  
     6  	pb "github.com/linkerd/linkerd2-proxy-api/go/identity"
     7  	"github.com/linkerd/linkerd2/pkg/tls"
     8  
     9  	fuzz "github.com/AdaLogics/go-fuzz-headers"
    10  )
    11  
    12  // FuzzServiceCertify fuzzes the Service.Certify method.
    13  func FuzzServiceCertify(data []byte) int {
    14  	f := fuzz.NewConsumer(data)
    15  	req := &pb.CertifyRequest{}
    16  	err := f.GenerateStruct(req)
    17  	if err != nil {
    18  		return 0
    19  	}
    20  
    21  	svc := NewService(&fakeValidator{"successful-result", nil}, nil, nil, nil, "", "", "")
    22  	svc.updateIssuer(&fakeIssuer{tls.Crt{}, nil})
    23  
    24  	_, _ = svc.Certify(context.Background(), req)
    25  	return 1
    26  }
    27  

View as plain text