From 205fb711b978f5ae551702b3ff06fe8d6fabadb2 Mon Sep 17 00:00:00 2001 From: Dmitry Yu Okunev Date: Tue, 2 Jul 2019 08:31:43 +0300 Subject: [PATCH 1/3] Use standard library "crypto/ed25519" --- crypto/ed25519.go | 3 +-- crypto/ed25519_test.go | 3 +-- crypto/key_not_openssl.go | 2 +- crypto/key_openssl.go | 2 +- crypto/key_test.go | 2 +- go.mod | 1 - go.sum | 9 +++------ 7 files changed, 8 insertions(+), 14 deletions(-) diff --git a/crypto/ed25519.go b/crypto/ed25519.go index ceb34837..1707e750 100644 --- a/crypto/ed25519.go +++ b/crypto/ed25519.go @@ -2,14 +2,13 @@ package crypto import ( "bytes" + "crypto/ed25519" "crypto/subtle" "errors" "fmt" "io" pb "github.com/libp2p/go-libp2p-core/crypto/pb" - - "golang.org/x/crypto/ed25519" ) // Ed25519PrivateKey is an ed25519 private key. diff --git a/crypto/ed25519_test.go b/crypto/ed25519_test.go index 222b5154..ae1bebe7 100644 --- a/crypto/ed25519_test.go +++ b/crypto/ed25519_test.go @@ -1,12 +1,11 @@ package crypto import ( + "crypto/ed25519" "crypto/rand" "testing" pb "github.com/libp2p/go-libp2p-core/crypto/pb" - - "golang.org/x/crypto/ed25519" ) func TestBasicSignAndVerify(t *testing.T) { diff --git a/crypto/key_not_openssl.go b/crypto/key_not_openssl.go index ae8b01f0..6b5b6fc2 100644 --- a/crypto/key_not_openssl.go +++ b/crypto/key_not_openssl.go @@ -5,10 +5,10 @@ package crypto import ( "crypto" "crypto/ecdsa" + "crypto/ed25519" "crypto/rsa" btcec "github.com/btcsuite/btcd/btcec" - "golang.org/x/crypto/ed25519" ) // KeyPairFromStdKey wraps standard library (and secp256k1) private keys in libp2p/go-libp2p-core/crypto keys diff --git a/crypto/key_openssl.go b/crypto/key_openssl.go index 4545492c..b948f3d0 100644 --- a/crypto/key_openssl.go +++ b/crypto/key_openssl.go @@ -5,12 +5,12 @@ package crypto import ( "crypto" "crypto/ecdsa" + "crypto/ed25519" "crypto/rsa" "crypto/x509" btcec "github.com/btcsuite/btcd/btcec" openssl "github.com/libp2p/go-openssl" - "golang.org/x/crypto/ed25519" ) // KeyPairFromStdKey wraps standard library (and secp256k1) private keys in libp2p/go-libp2p-core/crypto keys diff --git a/crypto/key_test.go b/crypto/key_test.go index aff2badd..984eaa11 100644 --- a/crypto/key_test.go +++ b/crypto/key_test.go @@ -4,6 +4,7 @@ import ( "bytes" "crypto" "crypto/ecdsa" + "crypto/ed25519" "crypto/elliptic" "crypto/rand" "crypto/rsa" @@ -15,7 +16,6 @@ import ( pb "github.com/libp2p/go-libp2p-core/crypto/pb" "github.com/libp2p/go-libp2p-core/test" sha256 "github.com/minio/sha256-simd" - "golang.org/x/crypto/ed25519" ) func TestKeys(t *testing.T) { diff --git a/go.mod b/go.mod index ff592748..196744bb 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,6 @@ require ( github.com/multiformats/go-multihash v0.0.10 github.com/smola/gocompat v0.2.0 go.opencensus.io v0.22.2 - golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 ) go 1.12 diff --git a/go.sum b/go.sum index 16c049e6..be747c91 100644 --- a/go.sum +++ b/go.sum @@ -91,8 +91,6 @@ github.com/mr-tron/base58 v1.1.3 h1:v+sk57XuaCKGXpWtVBX8YJzO7hMGx4Aajh4TQbdEFdc= github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/multiformats/go-base32 v0.0.3 h1:tw5+NhuwaOjJCC5Pp82QuXbrmLzWg7uxlMFp8Nq/kkI= github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL8NSQj0zQ5Nz/AA= -github.com/multiformats/go-multiaddr v0.1.1 h1:rVAztJYMhCQ7vEFr8FvxW3mS+HF2eY/oPbOMeS0ZDnE= -github.com/multiformats/go-multiaddr v0.1.1/go.mod h1:aMKBKNEYmzmDmxfX88/vz+J5IU55txyt0p4aiWVohjo= github.com/multiformats/go-multiaddr v0.1.2 h1:HWYHNSyyllbQopmVIF5K7JKJugiah+L9/kuZKHbmNdQ= github.com/multiformats/go-multiaddr v0.1.2/go.mod h1:0nO36NvPpyV4QzvTLi/lafl2y95ncPj0vFwVF6k6wJ4= github.com/multiformats/go-multibase v0.0.1 h1:PN9/v21eLywrFWdFNsFKaU04kLJzuYzmrJR+ubhT9qA= @@ -124,11 +122,10 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJzfthRT6usrui8uGmg= github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= -go.opencensus.io v0.22.1 h1:8dP3SGL7MPB94crU3bEPplMPe83FI4EouesJUeFHv50= -go.opencensus.io v0.22.1/go.mod h1:Ap50jQcDJrx6rB6VgeeFPtuPIf3wMRvRfrfYDO6+BmA= go.opencensus.io v0.22.2 h1:75k/FF0Q2YM8QYo07VPddOLBslDt1MZOdEslOHvmzAs= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -137,9 +134,8 @@ golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 h1:1wopBVtVdWnn03fZelqdXTqk7U7zPQCb+T4rbU9ZEoU= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -196,5 +192,6 @@ gopkg.in/src-d/go-log.v1 v1.0.1/go.mod h1:GN34hKP0g305ysm2/hctJ0Y8nWP3zxXXJ8GFab gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From cd602e126d7097e0440f80e2d0cd9aa2bcc1a1bb Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Sat, 7 Dec 2019 10:32:20 -0500 Subject: [PATCH 2/3] chore: bump minimum go version --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 196744bb..eac7e645 100644 --- a/go.mod +++ b/go.mod @@ -16,4 +16,4 @@ require ( go.opencensus.io v0.22.2 ) -go 1.12 +go 1.13 From d25b4807f34ba1963338366a1c5a6125733f3b0d Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Sat, 7 Dec 2019 10:33:06 -0500 Subject: [PATCH 3/3] docs(readme): specify minimum go version --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 81c319dc..5f90d393 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ > Home to the interfaces and abstractions that make up go-libp2p. +Minimum go version: 1.13 + ## Install ```sh