Skip to content

Commit

Permalink
feat: verify-blob --cert base64 (#1088)
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos A Becker <[email protected]>
  • Loading branch information
caarlos0 authored Nov 21, 2021
1 parent 5586790 commit aff2e37
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/cosign/cli/verify/verify_blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,14 @@ func VerifyBlobCmd(ctx context.Context, ko sign.KeyOpts, certRef, sigRef, blobRe
return err
}

certs, err := cryptoutils.LoadCertificatesFromPEM(bytes.NewReader(pems))
var out []byte
out, err = base64.StdEncoding.DecodeString(string(pems))
if err != nil {
// not a base64
out = pems
}

certs, err := cryptoutils.UnmarshalCertificatesFromPEM(out)
if err != nil {
return err
}
Expand Down

0 comments on commit aff2e37

Please sign in to comment.