Skip to content

Commit

Permalink
feat: not ignore invalid signing keys
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed Aug 5, 2022
1 parent 1e9c25e commit b1821ea
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ var serveCmd = &cobra.Command{
return errors.New("signing key must be defined")
}
block, _ := pem.Decode([]byte(signingKey))
if block == nil {
return errors.New("invalid signing key, cannot parse as PEM")
}
key, err := x509.ParsePKCS1PrivateKey(block.Bytes)
if err != nil {
return err
Expand Down

0 comments on commit b1821ea

Please sign in to comment.