Skip to content

Commit

Permalink
Just add critical bool to MarshalSubjectAltName
Browse files Browse the repository at this point in the history
  • Loading branch information
liamjm committed Mar 26, 2024
1 parent cb5af8b commit ee1735b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions x509/x509ext.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,9 @@ func forEachSAN(extension []byte, callback func(ext asn1.RawValue) error) error
return nil
}

// MarshalSubjectAltName converts a SubjectAltName struct into a pkix.Extension.
func MarshalSubjectAltName(san *SubjectAltName) (pkix.Extension, error) {
return MarshalSubjectAltNameWithCriticality(san, false)
}

// MarshalSubjectAltNameWithCriticality converts a SubjectAltName struct into a pkix.Extension,
// MarshalSubjectAltName converts a SubjectAltName struct into a pkix.Extension,
// allowing callers to specify if the extension is critical.
func MarshalSubjectAltNameWithCriticality(san *SubjectAltName, critical bool) (pkix.Extension, error) {
func MarshalSubjectAltName(san *SubjectAltName, critical bool) (pkix.Extension, error) {
var generalNames []asn1.RawValue
for _, permID := range san.PermanentIdentifiers {
val, err := marshalOtherName(oidPermanentIdentifier, permID)
Expand Down

0 comments on commit ee1735b

Please sign in to comment.