From 0efbd1015774a2d894138519f1efcf7704bb2d95 Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Sun, 8 Sep 2019 19:36:13 +0300 Subject: all: fix typos Use the following (suboptimal) script to obtain a list of possible typos: #!/usr/bin/env sh set -x git ls-files |\ grep -e '\.\(c\|cc\|go\)$' |\ xargs -n 1\ awk\ '/\/\// { gsub(/.*\/\//, ""); print; } /\/\*/, /\*\// { gsub(/.*\/\*/, ""); gsub(/\*\/.*/, ""); }' |\ hunspell -d en_US -l |\ grep '^[[:upper:]]\{0,1\}[[:lower:]]\{1,\}$' |\ grep -v -e '^.\{1,4\}$' -e '^.\{16,\}$' |\ sort -f |\ uniq -c |\ awk '$1 == 1 { print $2; }' Then, go through the results manually and fix the most obvious typos in the non-vendored code. Change-Id: I3cb5830a176850e1a0584b8a40b47bde7b260eae Reviewed-on: https://go-review.googlesource.com/c/go/+/193848 Reviewed-by: Robert Griesemer --- src/crypto/tls/handshake_client.go | 2 +- src/crypto/tls/prf.go | 2 +- src/crypto/x509/name_constraints_test.go | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/crypto') diff --git a/src/crypto/tls/handshake_client.go b/src/crypto/tls/handshake_client.go index 5ac2098ceb..f04311320e 100644 --- a/src/crypto/tls/handshake_client.go +++ b/src/crypto/tls/handshake_client.go @@ -991,7 +991,7 @@ func mutualProtocol(protos, preferenceProtos []string) (string, bool) { return protos[0], true } -// hostnameInSNI converts name into an approriate hostname for SNI. +// hostnameInSNI converts name into an appropriate hostname for SNI. // Literal IP addresses and absolute FQDNs are not permitted as SNI values. // See RFC 6066, Section 3. func hostnameInSNI(name string) string { diff --git a/src/crypto/tls/prf.go b/src/crypto/tls/prf.go index 05b87a9b89..aeba5fcbd7 100644 --- a/src/crypto/tls/prf.go +++ b/src/crypto/tls/prf.go @@ -263,7 +263,7 @@ func (h *finishedHash) discardHandshakeBuffer() { } // noExportedKeyingMaterial is used as a value of -// ConnectionState.ekm when renegotation is enabled and thus +// ConnectionState.ekm when renegotiation is enabled and thus // we wish to fail all key-material export requests. func noExportedKeyingMaterial(label string, context []byte, length int) ([]byte, error) { return nil, errors.New("crypto/tls: ExportKeyingMaterial is unavailable when renegotiation is enabled") diff --git a/src/crypto/x509/name_constraints_test.go b/src/crypto/x509/name_constraints_test.go index 2020e37a5b..8344240927 100644 --- a/src/crypto/x509/name_constraints_test.go +++ b/src/crypto/x509/name_constraints_test.go @@ -1457,7 +1457,7 @@ var nameConstraintsTests = []nameConstraintsTest{ // that we can process CA certificates in the wild that have invalid SANs. // See https://github.com/golang/go/issues/23995 - // #77: an invalid DNS or mail SAN will not be detected if name constaint + // #77: an invalid DNS or mail SAN will not be detected if name constraint // checking is not triggered. { roots: make([]constraintsSpec, 1), @@ -1631,7 +1631,7 @@ func makeConstraintsCACert(constraints constraintsSpec, name string, key *ecdsa. NotAfter: time.Unix(2000, 0), KeyUsage: KeyUsageCertSign, BasicConstraintsValid: true, - IsCA: true, + IsCA: true, } if err := addConstraintsToTemplate(constraints, template); err != nil { @@ -1668,7 +1668,7 @@ func makeConstraintsLeafCert(leaf leafSpec, key *ecdsa.PrivateKey, parent *Certi NotAfter: time.Unix(2000, 0), KeyUsage: KeyUsageDigitalSignature, BasicConstraintsValid: true, - IsCA: false, + IsCA: false, } for _, name := range leaf.sans { -- cgit v1.3-5-g9baa