Skip to content

Commit

Permalink
Updates based on review.
Browse files Browse the repository at this point in the history
  • Loading branch information
kitography committed Jan 27, 2025
1 parent f2e48a2 commit 99b3e3f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 0 additions & 8 deletions builtin/logical/pki/issuing/cert_verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,3 @@ func VerifyCertificate(ctx context.Context, storage logical.Storage, issuerId Is

return certutil.VerifyCertificate(parsedBundle, options)
}

func convertCertificate(certBytes []byte) (*ctx509.Certificate, error) {
ret, err := ctx509.ParseCertificate(certBytes)
if err != nil {
return nil, fmt.Errorf("cannot convert certificate for validation: %w", err)
}
return ret, nil
}
2 changes: 1 addition & 1 deletion sdk/helper/certutil/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func ParsePEMBundle(pemBundle string) (*ParsedCertBundle, error) {
}
}

if certPath != nil && len(certPath) > 1 {
if len(certPath) > 1 {
// Don't validate the certificate chain if no certificate exists eg. only a key is given
// And don't validate a chain if it isn't given (eg. only one certificate)
if err := parsedBundle.Verify(); err != nil {
Expand Down

0 comments on commit 99b3e3f

Please sign in to comment.