From b665ba6f6f9abc2ab124f8ec2cb44de0e44ce077 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 25 Sep 2023 17:15:31 +0000 Subject: [PATCH] all: use crypto/ed25519 instead of golang.org/x/crypto/ed25519 This is a follow-up to CL 317169, which dropped go1.12 compatibility, and made the golang.org/x/crypto/ed25519 package an alias / wrapper for crypto/ed25519 in stdlib. This patch updates uses within this repository to use stdlib instead of depending on the wrapper. With this patch applied, the only remaining use of the wrapper is in ed25519_test, which appears to be in place to verify compatibility of the wrapper itself. Change-Id: I0195396102a75ae20bdd82ca8ab59855c0eb5cea GitHub-Last-Rev: 24dbec563cbd84bc47bdc7736b0245fc83dd3353 GitHub-Pull-Request: golang/crypto#238 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/448238 Reviewed-by: Bryan Mills Run-TryBot: Nicola Murino Reviewed-by: Nicola Murino TryBot-Result: Gopher Robot Reviewed-by: Joedian Reid Reviewed-by: Roland Shoemaker Reviewed-by: Than McIntosh --- internal/wycheproof/eddsa_test.go | 3 +-- nacl/sign/sign.go | 2 +- ssh/agent/client.go | 2 +- ssh/agent/server.go | 2 +- ssh/keys.go | 2 +- ssh/keys_test.go | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/internal/wycheproof/eddsa_test.go b/internal/wycheproof/eddsa_test.go index 0a7fbb7e0e..118dfc043f 100644 --- a/internal/wycheproof/eddsa_test.go +++ b/internal/wycheproof/eddsa_test.go @@ -8,9 +8,8 @@ package wycheproof import ( + "crypto/ed25519" "testing" - - "golang.org/x/crypto/ed25519" ) func TestEddsa(t *testing.T) { diff --git a/nacl/sign/sign.go b/nacl/sign/sign.go index 8a6acdcc09..109c08bb95 100644 --- a/nacl/sign/sign.go +++ b/nacl/sign/sign.go @@ -21,9 +21,9 @@ package sign import ( + "crypto/ed25519" "io" - "golang.org/x/crypto/ed25519" "golang.org/x/crypto/internal/alias" ) diff --git a/ssh/agent/client.go b/ssh/agent/client.go index c3e112a939..9f09aae7dd 100644 --- a/ssh/agent/client.go +++ b/ssh/agent/client.go @@ -16,6 +16,7 @@ import ( "bytes" "crypto/dsa" "crypto/ecdsa" + "crypto/ed25519" "crypto/elliptic" "crypto/rsa" "encoding/base64" @@ -26,7 +27,6 @@ import ( "math/big" "sync" - "golang.org/x/crypto/ed25519" "golang.org/x/crypto/ssh" ) diff --git a/ssh/agent/server.go b/ssh/agent/server.go index 9a769de03d..dd2e0a3e71 100644 --- a/ssh/agent/server.go +++ b/ssh/agent/server.go @@ -7,6 +7,7 @@ package agent import ( "crypto/dsa" "crypto/ecdsa" + "crypto/ed25519" "crypto/elliptic" "crypto/rsa" "encoding/binary" @@ -16,7 +17,6 @@ import ( "log" "math/big" - "golang.org/x/crypto/ed25519" "golang.org/x/crypto/ssh" ) diff --git a/ssh/keys.go b/ssh/keys.go index bcaae50c72..ef1bad731b 100644 --- a/ssh/keys.go +++ b/ssh/keys.go @@ -11,6 +11,7 @@ import ( "crypto/cipher" "crypto/dsa" "crypto/ecdsa" + "crypto/ed25519" "crypto/elliptic" "crypto/md5" "crypto/rand" @@ -28,7 +29,6 @@ import ( "math/big" "strings" - "golang.org/x/crypto/ed25519" "golang.org/x/crypto/ssh/internal/bcrypt_pbkdf" ) diff --git a/ssh/keys_test.go b/ssh/keys_test.go index 365d93db99..76d2338f43 100644 --- a/ssh/keys_test.go +++ b/ssh/keys_test.go @@ -8,6 +8,7 @@ import ( "bytes" "crypto/dsa" "crypto/ecdsa" + "crypto/ed25519" "crypto/elliptic" "crypto/rand" "crypto/rsa" @@ -21,7 +22,6 @@ import ( "strings" "testing" - "golang.org/x/crypto/ed25519" "golang.org/x/crypto/ssh/testdata" )