Merge pull request #1266 from parakeety/use-current-keychain-version
walletunlocker: use KeyDerivationVersion for generating cipher seed
This commit is contained in:
commit
4d04b29b01
@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/roasbeef/btcd/chaincfg"
|
"github.com/roasbeef/btcd/chaincfg"
|
||||||
"github.com/roasbeef/btcwallet/wallet"
|
"github.com/roasbeef/btcwallet/wallet"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
|
"github.com/lightningnetwork/lnd/keychain"
|
||||||
)
|
)
|
||||||
|
|
||||||
// WalletInitMsg is a message sent by the UnlockerService when a user wishes to
|
// WalletInitMsg is a message sent by the UnlockerService when a user wishes to
|
||||||
@ -129,8 +130,9 @@ func (u *UnlockerService) GenSeed(ctx context.Context,
|
|||||||
// Now that we have our set of entropy, we'll create a new cipher seed
|
// Now that we have our set of entropy, we'll create a new cipher seed
|
||||||
// instance.
|
// instance.
|
||||||
//
|
//
|
||||||
// TODO(roasbeef): should use current keychain version here
|
cipherSeed, err := aezeed.New(
|
||||||
cipherSeed, err := aezeed.New(0, &entropy, time.Now())
|
keychain.KeyDerivationVersion, &entropy, time.Now(),
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ import (
|
|||||||
"github.com/roasbeef/btcd/chaincfg"
|
"github.com/roasbeef/btcd/chaincfg"
|
||||||
"github.com/roasbeef/btcwallet/wallet"
|
"github.com/roasbeef/btcwallet/wallet"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
|
"github.com/lightningnetwork/lnd/keychain"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -189,7 +190,9 @@ func TestInitWallet(t *testing.T) {
|
|||||||
|
|
||||||
// Once we have the unlocker service created, we'll now instantiate a
|
// Once we have the unlocker service created, we'll now instantiate a
|
||||||
// new cipher seed instance.
|
// new cipher seed instance.
|
||||||
cipherSeed, err := aezeed.New(0, &testEntropy, time.Now())
|
cipherSeed, err := aezeed.New(
|
||||||
|
keychain.KeyDerivationVersion, &testEntropy, time.Now(),
|
||||||
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("unable to create seed: %v", err)
|
t.Fatalf("unable to create seed: %v", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user