Fix comment typos and extra white spaces

This commit is contained in:
Mariano Cano 2022-09-23 10:50:44 -07:00
parent 2eba5326db
commit 965d59c0a8
3 changed files with 6 additions and 6 deletions

View File

@ -377,8 +377,8 @@ func (a *Authority) init() error {
if err != nil { if err != nil {
return err return err
} }
// If not defined with an option, add intermediates to the the list // If not defined with an option, add intermediates to the list of
// of certificates used for name constraints validation at issuance // certificates used for name constraints validation at issuance
// time. // time.
if len(a.intermediateX509Certs) == 0 { if len(a.intermediateX509Certs) == 0 {
a.intermediateX509Certs = append(a.intermediateX509Certs, options.CertificateChain...) a.intermediateX509Certs = append(a.intermediateX509Certs, options.CertificateChain...)

View File

@ -128,8 +128,8 @@ func (e *Engine) Validate(dnsNames []string, ipAddresses []net.IP, emailAddresse
return nil return nil
} }
// ValidateCertificate validates the DNS names, IP addresses, Email address and // ValidateCertificate validates the DNS names, IP addresses, Email addresses
// URIs present in the given certificate. // and URIs present in the given certificate.
func (e *Engine) ValidateCertificate(cert *x509.Certificate) error { func (e *Engine) ValidateCertificate(cert *x509.Certificate) error {
return e.Validate(cert.DNSNames, cert.IPAddresses, cert.EmailAddresses, cert.URIs) return e.Validate(cert.DNSNames, cert.IPAddresses, cert.EmailAddresses, cert.URIs)
} }

View File

@ -140,7 +140,7 @@ func TestEngine_Validate(t *testing.T) {
emailAddresses: []string{"root@example.com"}, emailAddresses: []string{"root@example.com"},
uris: []*url.URL{{Scheme: "https", Host: "example.com", Path: "/uuid/c6d1a755-0c12-431e-9136-b64cb3173ec7"}}, uris: []*url.URL{{Scheme: "https", Host: "example.com", Path: "/uuid/c6d1a755-0c12-431e-9136-b64cb3173ec7"}},
}, false}, }, false},
{"ok permitted dns ", fields{ {"ok permitted dns", fields{
hasNameConstraints: true, hasNameConstraints: true,
permittedDNSDomains: []string{"example.com"}, permittedDNSDomains: []string{"example.com"},
}, args{dnsNames: []string{"example.com", "www.example.com"}}, false}, }, args{dnsNames: []string{"example.com", "www.example.com"}}, false},
@ -163,7 +163,7 @@ func TestEngine_Validate(t *testing.T) {
{IP: net.ParseIP("192.168.2.1").To4(), Mask: net.IPMask{255, 255, 255, 255}}, {IP: net.ParseIP("192.168.2.1").To4(), Mask: net.IPMask{255, 255, 255, 255}},
}, },
}, args{ipAddresses: []net.IP{{192, 168, 2, 2}, {192, 168, 3, 1}}}, false}, }, args{ipAddresses: []net.IP{{192, 168, 2, 2}, {192, 168, 3, 1}}}, false},
{"ok permitted emails ", fields{ {"ok permitted emails", fields{
hasNameConstraints: true, hasNameConstraints: true,
permittedEmailAddresses: []string{"root@example.com", "acme.org", ".acme.com"}, permittedEmailAddresses: []string{"root@example.com", "acme.org", ".acme.com"},
}, args{emailAddresses: []string{"root@example.com", "name@acme.org", "name@coyote.acme.com", `"(quoted)"@www.acme.com`}}, false}, }, args{emailAddresses: []string{"root@example.com", "name@acme.org", "name@coyote.acme.com", `"(quoted)"@www.acme.com`}}, false},