Skip to content

Commit

Permalink
Require IsCA in CanIssue
Browse files Browse the repository at this point in the history
  • Loading branch information
hdecarne committed Dec 31, 2023
1 parent 72d8bda commit a703c20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion store.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ func (entry *RegistryEntry) IsCA() bool {
}

func (entry *RegistryEntry) CanIssue(keyUsage x509.KeyUsage) bool {
return entry.key != nil && entry.certificate != nil && (entry.certificate.KeyUsage&keyUsage) == keyUsage
return entry.key != nil && entry.certificate != nil && entry.certificate.BasicConstraintsValid && entry.certificate.IsCA && (entry.certificate.KeyUsage&keyUsage) == keyUsage
}

func (entry *RegistryEntry) HasKey() bool {
Expand Down

0 comments on commit a703c20

Please sign in to comment.