Skip to content

Commit

Permalink
Use ED25519ph only when uploading to TLog
Browse files Browse the repository at this point in the history
Signed-off-by: Riccardo Schirone <[email protected]>
  • Loading branch information
ret2libc committed Mar 1, 2024
1 parent 1046eea commit e01c68c
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 e01c68c

Please sign in to comment.