1
0
mirror of https://github.com/golang/go synced 2024-11-24 23:57:57 -07:00

fix maxConstraintComparisions typo (should be maxConstraintComparisons)

This commit is contained in:
Arnaud Hillen 2024-08-27 12:18:11 +00:00
parent 36b45bca66
commit b419975022
3 changed files with 6 additions and 6 deletions

View File

@ -42,7 +42,7 @@ pkg crypto/x509, type Certificate struct, PermittedURIDomains []string
pkg crypto/x509, type Certificate struct, URIs []*url.URL pkg crypto/x509, type Certificate struct, URIs []*url.URL
pkg crypto/x509, type CertificateInvalidError struct, Detail string pkg crypto/x509, type CertificateInvalidError struct, Detail string
pkg crypto/x509, type CertificateRequest struct, URIs []*url.URL pkg crypto/x509, type CertificateRequest struct, URIs []*url.URL
pkg crypto/x509, type VerifyOptions struct, MaxConstraintComparisions int pkg crypto/x509, type VerifyOptions struct, MaxConstraintComparisons int
pkg crypto/x509/pkix, method (Name) String() string pkg crypto/x509/pkix, method (Name) String() string
pkg crypto/x509/pkix, method (RDNSequence) String() string pkg crypto/x509/pkix, method (RDNSequence) String() string
pkg database/sql, func OpenDB(driver.Connector) *DB pkg database/sql, func OpenDB(driver.Connector) *DB

View File

@ -1269,7 +1269,7 @@ var PackageSymbols = map[string][]Symbol{
{"VerifyOptions.DNSName", Field, 0}, {"VerifyOptions.DNSName", Field, 0},
{"VerifyOptions.Intermediates", Field, 0}, {"VerifyOptions.Intermediates", Field, 0},
{"VerifyOptions.KeyUsages", Field, 1}, {"VerifyOptions.KeyUsages", Field, 1},
{"VerifyOptions.MaxConstraintComparisions", Field, 10}, {"VerifyOptions.MaxConstraintComparisons", Field, 10},
{"VerifyOptions.Roots", Field, 0}, {"VerifyOptions.Roots", Field, 0},
}, },
"crypto/x509/pkix": { "crypto/x509/pkix": {

View File

@ -49,7 +49,7 @@ const (
UnconstrainedName UnconstrainedName
// TooManyConstraints results when the number of comparison operations // TooManyConstraints results when the number of comparison operations
// needed to check a certificate exceeds the limit set by // needed to check a certificate exceeds the limit set by
// VerifyOptions.MaxConstraintComparisions. This limit exists to // VerifyOptions.MaxConstraintComparisons. This limit exists to
// prevent pathological certificates can consuming excessive amounts of // prevent pathological certificates can consuming excessive amounts of
// CPU time to verify. // CPU time to verify.
TooManyConstraints TooManyConstraints
@ -195,12 +195,12 @@ type VerifyOptions struct {
// means ExtKeyUsageServerAuth. To accept any key usage, include ExtKeyUsageAny. // means ExtKeyUsageServerAuth. To accept any key usage, include ExtKeyUsageAny.
KeyUsages []ExtKeyUsage KeyUsages []ExtKeyUsage
// MaxConstraintComparisions is the maximum number of comparisons to // MaxConstraintComparisons is the maximum number of comparisons to
// perform when checking a given certificate's name constraints. If // perform when checking a given certificate's name constraints. If
// zero, a sensible default is used. This limit prevents pathological // zero, a sensible default is used. This limit prevents pathological
// certificates from consuming excessive amounts of CPU time when // certificates from consuming excessive amounts of CPU time when
// validating. It does not apply to the platform verifier. // validating. It does not apply to the platform verifier.
MaxConstraintComparisions int MaxConstraintComparisons int
} }
const ( const (
@ -590,7 +590,7 @@ func (c *Certificate) isValid(certType int, currentChain []*Certificate, opts *V
} }
} }
maxConstraintComparisons := opts.MaxConstraintComparisions maxConstraintComparisons := opts.MaxConstraintComparisons
if maxConstraintComparisons == 0 { if maxConstraintComparisons == 0 {
maxConstraintComparisons = 250000 maxConstraintComparisons = 250000
} }