From b91329d961d4ba7270e79ed661eb324c299ab812 Mon Sep 17 00:00:00 2001 From: cui fliter Date: Tue, 5 Mar 2024 13:01:48 +0800 Subject: [PATCH] all: remove redundant words in comments and fix some typos Change-Id: I3078492dc020770aca630e0b362df0212bd41e32 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/569156 Auto-Submit: Ian Lance Taylor Reviewed-by: David Chase Reviewed-by: Nicola Murino Reviewed-by: Ian Lance Taylor Auto-Submit: Nicola Murino LUCI-TryBot-Result: Go LUCI --- internal/testenv/exec.go | 4 ++-- md4/md4.go | 2 +- ssh/certs_test.go | 18 +++++++++--------- ssh/example_test.go | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/internal/testenv/exec.go b/internal/testenv/exec.go index 4bacdc3ce8..df5d3c20df 100644 --- a/internal/testenv/exec.go +++ b/internal/testenv/exec.go @@ -57,8 +57,8 @@ func CommandContext(t testing.TB, ctx context.Context, name string, args ...stri // grace periods to clean up: one for the delay between the first // termination signal being sent (via the Cancel callback when the Context // expires) and the process being forcibly terminated (via the WaitDelay - // field), and a second one for the delay becween the process being - // terminated and and the test logging its output for debugging. + // field), and a second one for the delay between the process being + // terminated and the test logging its output for debugging. // // (We want to ensure that the test process itself has enough time to // log the output before it is also terminated.) diff --git a/md4/md4.go b/md4/md4.go index 59d3480693..d1911c2e86 100644 --- a/md4/md4.go +++ b/md4/md4.go @@ -4,7 +4,7 @@ // Package md4 implements the MD4 hash algorithm as defined in RFC 1320. // -// Deprecated: MD4 is cryptographically broken and should should only be used +// Deprecated: MD4 is cryptographically broken and should only be used // where compatibility with legacy systems, not security, is the goal. Instead, // use a secure hash like SHA-256 (from crypto/sha256). package md4 // import "golang.org/x/crypto/md4" diff --git a/ssh/certs_test.go b/ssh/certs_test.go index 97b7486d0c..66000f19a2 100644 --- a/ssh/certs_test.go +++ b/ssh/certs_test.go @@ -367,21 +367,21 @@ func TestCertTypes(t *testing.T) { func TestCertSignWithMultiAlgorithmSigner(t *testing.T) { type testcase struct { - sigAlgo string - algoritms []string + sigAlgo string + algorithms []string } cases := []testcase{ { - sigAlgo: KeyAlgoRSA, - algoritms: []string{KeyAlgoRSA, KeyAlgoRSASHA512}, + sigAlgo: KeyAlgoRSA, + algorithms: []string{KeyAlgoRSA, KeyAlgoRSASHA512}, }, { - sigAlgo: KeyAlgoRSASHA256, - algoritms: []string{KeyAlgoRSASHA256, KeyAlgoRSA, KeyAlgoRSASHA512}, + sigAlgo: KeyAlgoRSASHA256, + algorithms: []string{KeyAlgoRSASHA256, KeyAlgoRSA, KeyAlgoRSASHA512}, }, { - sigAlgo: KeyAlgoRSASHA512, - algoritms: []string{KeyAlgoRSASHA512, KeyAlgoRSASHA256}, + sigAlgo: KeyAlgoRSASHA512, + algorithms: []string{KeyAlgoRSASHA512, KeyAlgoRSASHA256}, }, } @@ -393,7 +393,7 @@ func TestCertSignWithMultiAlgorithmSigner(t *testing.T) { for _, c := range cases { t.Run(c.sigAlgo, func(t *testing.T) { - signer, err := NewSignerWithAlgorithms(testSigners["rsa"].(AlgorithmSigner), c.algoritms) + signer, err := NewSignerWithAlgorithms(testSigners["rsa"].(AlgorithmSigner), c.algorithms) if err != nil { t.Fatalf("NewSignerWithAlgorithms error: %v", err) } diff --git a/ssh/example_test.go b/ssh/example_test.go index 3920832c1a..97b3b6aba6 100644 --- a/ssh/example_test.go +++ b/ssh/example_test.go @@ -384,7 +384,7 @@ func ExampleCertificate_SignCert() { } mas, err := ssh.NewSignerWithAlgorithms(signer.(ssh.AlgorithmSigner), []string{ssh.KeyAlgoRSASHA256}) if err != nil { - log.Fatal("unable to create signer with algoritms: ", err) + log.Fatal("unable to create signer with algorithms: ", err) } certificate := ssh.Certificate{ Key: publicKey,