Skip to content

Commit

Permalink
Use ToED25519SignerVerifier
Browse files Browse the repository at this point in the history
Signed-off-by: Riccardo Schirone <[email protected]>
  • Loading branch information
ret2libc committed Feb 8, 2024
1 parent 16c0256 commit 1f5a737
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions cmd/cosign/cli/sign/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ func keylessSigner(ctx context.Context, ko options.KeyOpts, sv *SignerVerifier)
err error
)

fulcioSV, err := AdaptSignerVerifierToFulcio(sv)
fulcioSV, err := adaptSignerVerifierToFulcio(sv)
if err != nil {
return nil, fmt.Errorf("adapting signer verifier to Fulcio: %w", err)
}
Expand Down Expand Up @@ -629,14 +629,14 @@ func (c *SignerVerifier) Bytes(ctx context.Context) ([]byte, error) {
return pemBytes, nil
}

// AdaptSignerVerifierToFulcio adapts, if necessary, the SignerVerifier to be used to interact with Fulcio.
// adaptSignerVerifierToFulcio adapts, if necessary, the SignerVerifier to be used to interact with Fulcio.
//
// This is needed in particular for ED25519 keys with the pre-hashed version of
// the algorithm, which is not supported by Fulcio. This function creates a
// ED25519 SignerVerifier based on that instead.
func AdaptSignerVerifierToFulcio(sv *SignerVerifier) (*SignerVerifier, error) {
func adaptSignerVerifierToFulcio(sv *SignerVerifier) (*SignerVerifier, error) {
if ed25519phSV, ok := sv.SignerVerifier.(*signature.ED25519phSignerVerifier); ok {
signerVerifier, err := ed25519phSV.ConvertToED25519()
signerVerifier, err := ed25519phSV.ToED25519SignerVerifier()
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ require (
github.com/secure-systems-lab/go-securesystemslib v0.8.0
github.com/sigstore/fulcio v1.4.3
github.com/sigstore/rekor v1.3.4
github.com/sigstore/sigstore v1.8.2-0.20240129195947-e1f9a175c451
github.com/sigstore/sigstore v1.8.2-0.20240206082515-7fa5044eab09
github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.1
github.com/sigstore/sigstore/pkg/signature/kms/azure v1.8.1
github.com/sigstore/sigstore/pkg/signature/kms/gcp v1.8.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ github.com/shibumi/go-pathspec v1.3.0 h1:QUyMZhFo0Md5B8zV8x2tesohbb5kfbpTi9rBnKh
github.com/shibumi/go-pathspec v1.3.0/go.mod h1:Xutfslp817l2I1cZvgcfeMQJG5QnU2lh5tVaaMCl3jE=
github.com/sigstore/fulcio v1.4.3 h1:9JcUCZjjVhRF9fmhVuz6i1RyhCc/EGCD7MOl+iqCJLQ=
github.com/sigstore/fulcio v1.4.3/go.mod h1:BQPWo7cfxmJwgaHlphUHUpFkp5+YxeJes82oo39m5og=
github.com/sigstore/sigstore v1.8.2-0.20240129195947-e1f9a175c451 h1:ypAyd4AiAndzEED10G5JO/cxSJ2xAERD1aNpWtr8a4Q=
github.com/sigstore/sigstore v1.8.2-0.20240129195947-e1f9a175c451/go.mod h1:rbZxJoss0Qf/OQeIuyqkQxo9jLKZlyLqOGX0BUaK7/I=
github.com/sigstore/sigstore v1.8.2-0.20240206082515-7fa5044eab09 h1:BpZhOReWZECJ1okzh5N9G/UjfoAWPm7Gy58vZHGE9zU=
github.com/sigstore/sigstore v1.8.2-0.20240206082515-7fa5044eab09/go.mod h1:rbZxJoss0Qf/OQeIuyqkQxo9jLKZlyLqOGX0BUaK7/I=
github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.1 h1:rEDdUefulkIQaMJyzLwtgPDLNXBIltBABiFYfb0YmgQ=
github.com/sigstore/sigstore/pkg/signature/kms/aws v1.8.1/go.mod h1:RCdYCc1IxCYWzh2IdzdA6Yf7JIY0cMRqH08fpQYechw=
github.com/sigstore/sigstore/pkg/signature/kms/azure v1.8.1 h1:DvRWG99QGWZC5mp42SEde2Xke/Q384Idnj2da7yB+Mk=
Expand Down

0 comments on commit 1f5a737

Please sign in to comment.