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 | Bin 90531 -> 90628 bytes pkg/util/config/crypto.go | 3 ++- 4 files changed, 5 insertions(+), 4 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 fd5acc1acdf6e2e70c776c46851c2c33f5d68449..10c70ac20a67b76f3d0bc20657cd98d2c8eef120 100644 GIT binary patch delta 151 zcmZ2{n6>2y>xQmw17n2@L#v<)C-3Ck+{BWkU|*wT*AVxNGUKAmlH8)~P=oZ)yl~GF zzo@d3BBv5hgUN~Q;*;NZa#>oM>KW^&=j-L>r+|zoF*L0Ra&rmGs4~shFDNc4C`ri= zxAe30@^bRaGt7uGa}4nH%XBvLEt;IrE;0FCkKkn6o+FHglV|h>PtNJp*{smpd<6hF C88^!S delta 91 zcmV-h0Hptf#08_n1+a>XFESu#F*;XaMr3h%WN}1GGI(lObwgEJMNU*qH8o~eH&Sn8 xRWdVmM`ToScr-OqlVFD!lkbTN1UWS>GLtZiP?M014wF5M#FN^MAG3jtgVgm|BLe^c 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 }