Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Herman Slatman <hslatman@users.noreply.github.com>
  • Loading branch information
maraino and hslatman committed Aug 10, 2022
1 parent f30f495 commit 8de4757
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions x509util/certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ func NewCertificate(cr *x509.CertificateRequest, opts ...Option) (*Certificate,
cert.PublicKey = cr.PublicKey
cert.PublicKeyAlgorithm = cr.PublicKeyAlgorithm

// Generate the subjectAltName extension if has SANs not directly supported
// by Go.
// Generate the subjectAltName extension if the certificate contains
// SANs that are not supported in the Go standard library.
if cert.hasExtendedSANs() && !cert.hasExtension(oidExtensionSubjectAltName) {
ext, err := createSubjectAltNameExtension(&cert, cert.Subject.IsEmpty())
if err != nil {
return nil, err
}
// Prepend extension to achieve a certificate as similar as possible to
// the one generated by the standard Go library.
// the one generated by the Go standard library.
cert.Extensions = append([]Extension{ext}, cert.Extensions...)
}

Expand Down
2 changes: 1 addition & 1 deletion x509util/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func newName(n pkix.Name) Name {
}
}

// goValue converts Subject to the Go representation.
// goValue converts Name to its Go representation.
func (n Name) goValue() pkix.Name {
return pkix.Name{
Country: n.Country,
Expand Down

0 comments on commit 8de4757

Please sign in to comment.