Skip to content

Commit

Permalink
Move deprecated dependency: google/trillian/merkle to transparency-dev
Browse files Browse the repository at this point in the history
Signed-off-by: cpanato <[email protected]>
  • Loading branch information
cpanato committed May 23, 2022
1 parent 60b86d9 commit 474100e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ require (
github.com/google/go-containerregistry v0.8.1-0.20220209165246-a44adc326839
github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20220413173345-f1b065c6cb3d
github.com/google/go-github/v42 v42.0.0
github.com/google/trillian v1.4.0
github.com/hashicorp/errwrap v1.1.0
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-hclog v1.2.0
Expand Down Expand Up @@ -66,6 +65,7 @@ require (
github.com/stretchr/testify v1.7.1
github.com/theupdateframework/go-tuf v0.3.0
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399
github.com/transparency-dev/merkle v0.0.1
github.com/withfig/autocomplete-tools/packages/cobra v0.0.0-20220122124547-31d3821a6898
github.com/xanzy/go-gitlab v0.65.0
go.uber.org/atomic v1.9.0
Expand Down Expand Up @@ -198,6 +198,7 @@ require (
github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20220301182634-bfe2ffc6b6bd // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/trillian v1.4.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/gax-go/v2 v2.3.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2187,6 +2187,8 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1
github.com/tomarrell/wrapcheck/v2 v2.4.0/go.mod h1:68bQ/eJg55BROaRTbMjC7vuhL2OgfoG8bLp9ZyoBfyY=
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce/go.mod h1:o8v6yHRoik09Xen7gje4m9ERNah1d1PPsVq1VEx9vE4=
github.com/tommy-muehle/go-mnd/v2 v2.4.0/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw=
github.com/transparency-dev/merkle v0.0.1 h1:T9/9gYB8uZl7VOJIhdwjALeRWlxUxSfDEysjfmx+L9E=
github.com/transparency-dev/merkle v0.0.1/go.mod h1:B8FIw5LTq6DaULoHsVFRzYIUDkl8yuSwCdZnOZGKL/A=
github.com/tsenart/go-tsz v0.0.0-20180814232043-cdeb9e1e981e/go.mod h1:SWZznP1z5Ki7hDT2ioqiFKEse8K9tU2OUvaRI0NeGQo=
github.com/tsenart/vegeta/v12 v12.8.4/go.mod h1:ZiJtwLn/9M4fTPdMY7bdbIeyNeFVE8/AHbWFqCsUuho=
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
Expand Down
3 changes: 2 additions & 1 deletion internal/pkg/cosign/rekor/mock/mock_rekor_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import (
"encoding/hex"

"github.com/go-openapi/runtime"
"github.com/google/trillian/merkle/rfc6962"
"github.com/transparency-dev/merkle/rfc6962"

"github.com/sigstore/rekor/pkg/generated/client/entries"
"github.com/sigstore/rekor/pkg/generated/models"
)
Expand Down
12 changes: 6 additions & 6 deletions pkg/cosign/tlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ import (

"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/google/trillian/merkle/logverifier"
"github.com/google/trillian/merkle/rfc6962"
"github.com/transparency-dev/merkle/proof"
"github.com/transparency-dev/merkle/rfc6962"

"github.com/sigstore/cosign/pkg/cosign/bundle"
"github.com/sigstore/cosign/pkg/cosign/tuf"
"github.com/sigstore/rekor/pkg/generated/client/index"

"github.com/sigstore/rekor/pkg/generated/client"
"github.com/sigstore/rekor/pkg/generated/client/entries"
"github.com/sigstore/rekor/pkg/generated/client/index"
"github.com/sigstore/rekor/pkg/generated/models"
hashedrekord_v001 "github.com/sigstore/rekor/pkg/types/hashedrekord/v0.0.1"
intoto_v001 "github.com/sigstore/rekor/pkg/types/intoto/v0.0.1"
Expand Down Expand Up @@ -345,8 +345,8 @@ func VerifyTLogEntry(ctx context.Context, rekorClient *client.Rekor, e *models.L
leafHash := rfc6962.DefaultHasher.HashLeaf(entryBytes)

// Verify the inclusion proof.
v := logverifier.New(rfc6962.DefaultHasher)
if err := v.VerifyInclusionProof(*e.Verification.InclusionProof.LogIndex, *e.Verification.InclusionProof.TreeSize, hashes, rootHash, leafHash); err != nil {
if err := proof.VerifyInclusion(rfc6962.DefaultHasher, uint64(*e.Verification.InclusionProof.LogIndex), uint64(*e.Verification.InclusionProof.TreeSize),
leafHash, hashes, rootHash); err != nil {
return fmt.Errorf("verifying inclusion proof: %w", err)
}

Expand Down

0 comments on commit 474100e

Please sign in to comment.