Skip to content

Commit

Permalink
Use ED25519ph only when uploading to TLog
Browse files Browse the repository at this point in the history
  • Loading branch information
ret2libc committed Feb 29, 2024
1 parent 1046eea commit 19222ef
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/cosign/cli/sign/sign_blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ func SignBlobCmd(ro *options.RootOptions, ko options.KeyOpts, payloadPath string

svOptions := []signature.LoadOption{
signatureoptions.WithHash(crypto.SHA256),
signatureoptions.WithED25519ph(),
}
// Use ED25519 pre-hashed version only when uploading to tlog to maintain
// backwards compatibility. When self-managed keys are used this keeps the
// behavior consistent with older cosign clients, which will still be able
// to verify the newer signatures.
if tlogUpload {
svOptions = append(svOptions, signatureoptions.WithED25519ph())
}

sv, err := signerFromKeyOptsWithSVOpts(ctx, "", "", ko, svOptions...)
Expand Down

0 comments on commit 19222ef

Please sign in to comment.