Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop strfmt.Base64 from pkg/oci. #1083

Merged
merged 2 commits into from
Nov 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/cosign/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ func VerifyBundle(sig oci.Signature) (bool, error) {
return false, errors.Wrap(err, "pem to ecdsa")
}

if err := VerifySET(bundle.Payload, []byte(bundle.SignedEntryTimestamp), rekorPubKey); err != nil {
if err := VerifySET(bundle.Payload, bundle.SignedEntryTimestamp, rekorPubKey); err != nil {
return false, err
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/oci/signatures.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package oci
import (
"crypto/x509"

"github.com/go-openapi/strfmt"
v1 "github.com/google/go-containerregistry/pkg/v1"
)

Expand Down Expand Up @@ -64,7 +63,7 @@ type Signature interface {
// Bundle holds metadata about recording a Signature's ephemeral key to
// a Rekor transparency log.
type Bundle struct {
SignedEntryTimestamp strfmt.Base64
SignedEntryTimestamp []byte
Payload BundlePayload
}

Expand Down
5 changes: 3 additions & 2 deletions pkg/oci/static/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"reflect"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-containerregistry/pkg/v1/types"
"github.com/sigstore/cosign/pkg/oci"
ctypes "github.com/sigstore/cosign/pkg/types"
Expand Down Expand Up @@ -86,7 +87,7 @@ func TestOptions(t *testing.T) {
LayerMediaType: ctypes.SimpleSigningMediaType,
ConfigMediaType: types.OCIConfigJSON,
Annotations: map[string]string{
BundleAnnotationKey: "{\"SignedEntryTimestamp\":\"\",\"Payload\":{\"body\":null,\"integratedTime\":0,\"logIndex\":0,\"logID\":\"\"}}",
BundleAnnotationKey: "{\"SignedEntryTimestamp\":null,\"Payload\":{\"body\":null,\"integratedTime\":0,\"logIndex\":0,\"logID\":\"\"}}",
},
Bundle: bundle,
},
Expand All @@ -100,7 +101,7 @@ func TestOptions(t *testing.T) {
}

if !reflect.DeepEqual(got, test.want) {
t.Errorf("makeOptions() = %#v, wanted %#v", got, test.want)
t.Errorf("makeOptions() = %s", cmp.Diff(got, test.want))
}
})
}
Expand Down