Skip to content

Commit

Permalink
crypto/tls: allow the usage of other keyUsage when checking for the d…
Browse files Browse the repository at this point in the history
…c extension #72 (#73)
  • Loading branch information
claucece authored and Lekensteyn committed Jan 14, 2022
1 parent baea2bd commit 08d9645
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/crypto/x509/x509.go
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ func buildCertExtensions(template *Certificate, subjectIsEmpty bool, authorityKe
}

// This extension is not critical
if template.KeyUsage == KeyUsageDigitalSignature && template.AllowDC && !template.IsCA && !oidInExtensions(oidExtensionDelegatedCredential, template.ExtraExtensions) {
if template.AllowDC && !template.IsCA && !oidInExtensions(oidExtensionDelegatedCredential, template.ExtraExtensions) && (template.KeyUsage&KeyUsageDigitalSignature != 0) {
ret[n].Id = oidExtensionDelegatedCredential
ret[n].Value, err = asn1.Marshal(asn1.NullRawValue)
if err != nil {
Expand Down

0 comments on commit 08d9645

Please sign in to comment.