From dab33e0f9b664e3efc3179170a717a28f54da0e2 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 28 Jun 2021 17:24:04 +0300 Subject: [PATCH] [#652] Update Neo Go to v0.95.3 Add `keys.NEP2ScryptParams()` to `keys.NEP2Decrypt` call arguments. Signed-off-by: Leonard Lyubich --- cmd/neofs-cli/modules/root.go | 4 ++-- go.mod | 2 +- go.sum | 5 +++-- pkg/util/config/crypto.go | 3 ++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cmd/neofs-cli/modules/root.go b/cmd/neofs-cli/modules/root.go index 6ae57f06c..2fcaeb866 100644 --- a/cmd/neofs-cli/modules/root.go +++ b/cmd/neofs-cli/modules/root.go @@ -214,7 +214,7 @@ func getKeyFromNEP2(encryptedWif string) (*ecdsa.PrivateKey, error) { return nil, errInvalidPassword } - k, err := keys.NEP2Decrypt(encryptedWif, pass) + k, err := keys.NEP2Decrypt(encryptedWif, pass, keys.NEP2ScryptParams()) if err != nil { printVerbose("Invalid key or password: %v", err) return nil, errInvalidPassword @@ -247,7 +247,7 @@ func getKeyFromWallet(w *wallet.Wallet, addrStr string) (*ecdsa.PrivateKey, erro return nil, errInvalidPassword } - if err := acc.Decrypt(pass); err != nil { + if err := acc.Decrypt(pass, keys.NEP2ScryptParams()); err != nil { printVerbose("Can't decrypt account: %v", err) return nil, errInvalidPassword } diff --git a/go.mod b/go.mod index 422bbc8a9..10f6dbd24 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/mr-tron/base58 v1.2.0 github.com/multiformats/go-multiaddr v0.3.2 github.com/nspcc-dev/hrw v1.0.9 - github.com/nspcc-dev/neo-go v0.95.2 + github.com/nspcc-dev/neo-go v0.95.3 github.com/nspcc-dev/neofs-api-go v1.27.2-0.20210623145243-07fcaa4ba5cc github.com/nspcc-dev/neofs-sdk-go v0.0.0-20210520210714-9dee13f0d556 github.com/nspcc-dev/tzhash v1.4.0 diff --git a/go.sum b/go.sum index fd5acc1ac..10c70ac20 100644 --- a/go.sum +++ b/go.sum @@ -365,10 +365,11 @@ github.com/nspcc-dev/neo-go v0.73.1-pre.0.20200303142215-f5a1b928ce09/go.mod h1: github.com/nspcc-dev/neo-go v0.91.0/go.mod h1:G6HdOWvzQ6tlvFdvFSN/PgCzLPN/X/X4d5hTjFRUDcc= github.com/nspcc-dev/neo-go v0.95.0/go.mod h1:bW07ge1WFXsBgqrcPpLUr6OcyQxHqM26MZNesWMdH0c= github.com/nspcc-dev/neo-go v0.95.1/go.mod h1:bW07ge1WFXsBgqrcPpLUr6OcyQxHqM26MZNesWMdH0c= -github.com/nspcc-dev/neo-go v0.95.2 h1:WaFdqzdqDK2xjXuCUZENTL55fW7RodU23uGdTqx45RY= -github.com/nspcc-dev/neo-go v0.95.2/go.mod h1:bW07ge1WFXsBgqrcPpLUr6OcyQxHqM26MZNesWMdH0c= +github.com/nspcc-dev/neo-go v0.95.3 h1:RxBKcmmatbSM2cETGhv3ritmrkU0gUnWItNZvtrBtI0= +github.com/nspcc-dev/neo-go v0.95.3/go.mod h1:t15xRFDVhz5o/pstptdoW9N9JJBNn1hZ6APMNiC6MrY= github.com/nspcc-dev/neofs-api-go v1.24.0/go.mod h1:G7dqincfdjBrAbL5nxVp82emF05fSVEqe59ICsoRDI8= github.com/nspcc-dev/neofs-api-go v1.26.1/go.mod h1:SHuH1Ba3U/h3j+8HHbb3Cns1LfMlEb88guWog9Qi68Y= +github.com/nspcc-dev/neofs-api-go v1.27.1/go.mod h1:i0Cwgvcu9A4M4e58pydbXFisUhSxpfljmuWFPIp2btE= github.com/nspcc-dev/neofs-api-go v1.27.2-0.20210623145243-07fcaa4ba5cc h1:GLLzWOQVeO9FATZodCG/AzmcV05mh8CcEXgoa3/SSM8= github.com/nspcc-dev/neofs-api-go v1.27.2-0.20210623145243-07fcaa4ba5cc/go.mod h1:i0Cwgvcu9A4M4e58pydbXFisUhSxpfljmuWFPIp2btE= github.com/nspcc-dev/neofs-crypto v0.2.0/go.mod h1:F/96fUzPM3wR+UGsPi3faVNmFlA9KAEAUQR7dMxZmNA= diff --git a/pkg/util/config/crypto.go b/pkg/util/config/crypto.go index 2564b21c0..0e74da950 100644 --- a/pkg/util/config/crypto.go +++ b/pkg/util/config/crypto.go @@ -3,6 +3,7 @@ package config import ( "errors" + "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/nspcc-dev/neo-go/pkg/encoding/address" "github.com/nspcc-dev/neo-go/pkg/wallet" ) @@ -26,7 +27,7 @@ func LoadAccount(path, addr, password string) (*wallet.Account, error) { return nil, errors.New("account is missing") } - if err := acc.Decrypt(password); err != nil { + if err := acc.Decrypt(password, keys.NEP2ScryptParams()); err != nil { return nil, err }