@@ -62,6 +62,7 @@ import (
62
62
"github.com/sigstore/sigstore/pkg/signature/dsse"
63
63
signatureoptions "github.com/sigstore/sigstore/pkg/signature/options"
64
64
sigPayload "github.com/sigstore/sigstore/pkg/signature/payload"
65
+ "google.golang.org/protobuf/encoding/protojson"
65
66
66
67
// Loads OIDC providers
67
68
_ "github.com/sigstore/cosign/v2/pkg/providers/all"
@@ -190,7 +191,7 @@ func SignCmd(ro *options.RootOptions, ko options.KeyOpts, signOpts options.SignO
190
191
return fmt .Errorf ("accessing image: %w" , err )
191
192
}
192
193
if signOpts .NewBundleFormat {
193
- err = signDigestBundle (ctx , digest , staticPayload , ko , signOpts , annotations , dd , sv , se )
194
+ err = signDigestBundle (ctx , digest , ko , signOpts , sv )
194
195
} else {
195
196
err = signDigest (ctx , digest , staticPayload , ko , signOpts , annotations , dd , sv , se )
196
197
}
@@ -213,7 +214,7 @@ func SignCmd(ro *options.RootOptions, ko options.KeyOpts, signOpts options.SignO
213
214
}
214
215
digest := ref .Context ().Digest (d .String ())
215
216
if signOpts .NewBundleFormat {
216
- err = signDigestBundle (ctx , digest , staticPayload , ko , signOpts , annotations , dd , sv , se )
217
+ err = signDigestBundle (ctx , digest , ko , signOpts , sv )
217
218
} else {
218
219
err = signDigest (ctx , digest , staticPayload , ko , signOpts , annotations , dd , sv , se )
219
220
}
@@ -229,10 +230,7 @@ func SignCmd(ro *options.RootOptions, ko options.KeyOpts, signOpts options.SignO
229
230
return nil
230
231
}
231
232
232
- func signDigestBundle (ctx context.Context , digest name.Digest , payload []byte , ko options.KeyOpts , signOpts options.SignOptions ,
233
- annotations map [string ]interface {},
234
- dd mutate.DupeDetector , sv * SignerVerifier , se oci.SignedEntity ) error {
235
-
233
+ func signDigestBundle (ctx context.Context , digest name.Digest , ko options.KeyOpts , signOpts options.SignOptions , sv * SignerVerifier ) error {
236
234
digestParts := strings .Split (digest .DigestStr (), ":" )
237
235
if len (digestParts ) != 2 {
238
236
return fmt .Errorf ("unable to parse digest %s" , digest .DigestStr ())
@@ -243,13 +241,13 @@ func signDigestBundle(ctx context.Context, digest name.Digest, payload []byte, k
243
241
}
244
242
predicateType := "https://sigstore.dev/cosign/sign/v1"
245
243
246
- statement := intotov1.Statement {
244
+ statement := & intotov1.Statement {
247
245
Type : intotov1 .StatementTypeUri ,
248
246
Subject : []* intotov1.ResourceDescriptor {& subject },
249
247
PredicateType : predicateType ,
250
248
}
251
249
252
- payload , err := json .Marshal (statement )
250
+ payload , err := protojson .Marshal (statement )
253
251
if err != nil {
254
252
return err
255
253
}
0 commit comments