Skip to content

Commit

Permalink
fix(sign): kms unspported message
Browse files Browse the repository at this point in the history
Signed-off-by: Furkan <furkan.turkal@trendyol.com>
  • Loading branch information
Dentrax committed Feb 17, 2022
1 parent 1615afb commit 6c3adc9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/signature/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,13 @@ func SignerVerifierFromKeyRef(ctx context.Context, keyRef string, pf cosign.Pass
}

return cosign.LoadPrivateKey([]byte(pk), []byte(pass))
case strings.Contains(keyRef, "://"):
return nil, fmt.Errorf("unsupported provider given")
}

sv, err := kms.Get(ctx, keyRef, crypto.SHA256)
if err == nil {
if strings.Contains(keyRef, "://") {
sv, err := kms.Get(ctx, keyRef, crypto.SHA256)
if err != nil {
return nil, fmt.Errorf("kms get: %v", err)
}
return sv, nil
}

Expand Down

0 comments on commit 6c3adc9

Please sign in to comment.