Skip to content

Commit 8c19add

Browse files
committed
Revert "pass verifier"
This reverts commit 6310637.
1 parent 139b734 commit 8c19add

File tree

5 files changed

+7
-22
lines changed

5 files changed

+7
-22
lines changed

cmd/gcp/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,12 @@ func awaitSignal(doneFn func()) {
200200
doneFn()
201201
}
202202

203-
func newGCPStorage(ctx context.Context, signer note.Signer, verifier note.Verifier) (*sctfe.CTStorage, error) {
203+
func newGCPStorage(ctx context.Context, signer note.Signer) (*sctfe.CTStorage, error) {
204204
gcpCfg := gcpTessera.Config{
205205
Bucket: *bucket,
206206
Spanner: *spannerDB,
207207
}
208-
tesseraStorage, err := gcpTessera.New(ctx, gcpCfg, tessera.WithCheckpointSignerVerifier(signer, verifier), tessera.WithCTLayout())
208+
tesseraStorage, err := gcpTessera.New(ctx, gcpCfg, tessera.WithCheckpointSignerVerifier(signer, nil), tessera.WithCTLayout())
209209
if err != nil {
210210
return nil, fmt.Errorf("Failed to initialize GCP Tessera storage: %v", err)
211211
}

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ require (
4242
github.com/beorn7/perks v1.0.1 // indirect
4343
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
4444
github.com/cespare/xxhash/v2 v2.3.0 // indirect
45-
github.com/cisco/go-tls-syntax v0.0.0-20200617162716-46b0cfb76b9b // indirect
4645
github.com/cncf/xds/go v0.0.0-20240905190251-b4127c9b8d78 // indirect
4746
github.com/envoyproxy/go-control-plane v0.13.0 // indirect
4847
github.com/envoyproxy/protoc-gen-validate v1.1.0 // indirect

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,8 +664,6 @@ github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL
664664
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
665665
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
666666
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
667-
github.com/cisco/go-tls-syntax v0.0.0-20200617162716-46b0cfb76b9b h1:Ves2turKTX7zruivAcUOQg155xggcbv3suVdbKCBQNM=
668-
github.com/cisco/go-tls-syntax v0.0.0-20200617162716-46b0cfb76b9b/go.mod h1:0AZAV7lYvynZQ5ErHlGMKH+4QYMyNCFd+AiL9MlrCYA=
669667
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
670668
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
671669
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=

instance.go

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,16 @@ import (
2525
"github.com/google/certificate-transparency-go/asn1"
2626
"github.com/google/certificate-transparency-go/x509util"
2727
"github.com/google/trillian/monitoring"
28-
tnote "github.com/transparency-dev/formats/note"
2928
"golang.org/x/mod/sumdb/note"
3029
)
3130

32-
type createStorageFunc func(context.Context, note.Signer, note.Verifier) (*CTStorage, error)
33-
3431
// InstanceOptions describes the options for a log instance.
3532
type InstanceOptions struct {
3633
// Validated holds the original configuration options for the log, and some
3734
// of its fields parsed as a result of validating it.
3835
Validated *ValidatedLogConfig
3936
// CreateStorage instantiates a Tessera storage implementation with a signer option.
40-
CreateStorage createStorageFunc
37+
CreateStorage func(context.Context, note.Signer) (*CTStorage, error)
4138
// Deadline is a timeout for Tessera requests.
4239
Deadline time.Duration
4340
// MetricFactory allows creating metrics.
@@ -95,19 +92,10 @@ func SetUpInstance(ctx context.Context, opts InstanceOptions) (*Instance, error)
9592
timeSource := new(SystemTimeSource)
9693
ctSigner := NewCpSigner(cfg.Signer, cfg.Origin, logID, timeSource)
9794

98-
vkey, err := tnote.RFC6962VerifierString(cfg.Origin, cfg.Signer.Public())
99-
if err != nil {
100-
return nil, fmt.Errorf("failed to create verifier key: %v", err)
101-
}
102-
ctVerifier, err := tnote.NewRFC6962Verifier(vkey)
103-
if err != nil {
104-
return nil, fmt.Errorf("failed to create verifier: %v", err)
105-
}
106-
10795
if opts.CreateStorage == nil {
10896
return nil, fmt.Errorf("failed to initiate storage backend: nil createStorage")
10997
}
110-
storage, err := opts.CreateStorage(ctx, ctSigner, ctVerifier)
98+
storage, err := opts.CreateStorage(ctx, ctSigner)
11199
if err != nil {
112100
return nil, fmt.Errorf("failed to initiate storage backend: %v", err)
113101
}

instance_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
"golang.org/x/mod/sumdb/note"
3131
)
3232

33-
func fakeCTStorage(_ context.Context, _ note.Signer, _ note.Verifier) (*CTStorage, error) {
33+
func fakeCTStorage(_ context.Context, _ note.Signer) (*CTStorage, error) {
3434
return &CTStorage{}, nil
3535
}
3636

@@ -52,7 +52,7 @@ func TestSetUpInstance(t *testing.T) {
5252
extKeyUsages string
5353
rejectExtensions string
5454
signer crypto.Signer
55-
ctStorage createStorageFunc
55+
ctStorage func(context.Context, note.Signer) (*CTStorage, error)
5656
wantErr string
5757
}{
5858
{
@@ -150,7 +150,7 @@ func TestSetUpInstance(t *testing.T) {
150150
spannerDB: "spanner",
151151
rootsPemFile: "./testdata/fake-ca.cert",
152152
signer: signer,
153-
ctStorage: func(_ context.Context, _ note.Signer, _ note.Verifier) (*CTStorage, error) {
153+
ctStorage: func(_ context.Context, _ note.Signer) (*CTStorage, error) {
154154
return nil, fmt.Errorf("I failed")
155155
},
156156
wantErr: "failed to initiate storage backend",

0 commit comments

Comments
 (0)