mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-19 14:34:17 +00:00
Fixed all imports in keys
This commit is contained in:
@@ -24,7 +24,7 @@ func (es encryptedStorage) Put(name, pass string, key crypto.PrivKey) error {
|
||||
func (es encryptedStorage) Get(name, pass string) (crypto.PrivKey, keys.Info, error) {
|
||||
secret, info, err := es.store.Get(name)
|
||||
if err != nil {
|
||||
return nil, info, err
|
||||
return crypto.PrivKey{}, info, err
|
||||
}
|
||||
key, err := es.coder.Decrypt(secret, pass)
|
||||
return key, info, err
|
||||
@@ -44,6 +44,6 @@ func info(name string, key crypto.PrivKey) keys.Info {
|
||||
return keys.Info{
|
||||
Name: name,
|
||||
Address: pub.Address(),
|
||||
PubKey: crypto.PubKeyS{pub},
|
||||
PubKey: pub,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ func (e secretbox) Decrypt(data []byte, pass string) (crypto.PrivKey, error) {
|
||||
s := secret(pass)
|
||||
private, err := crypto.DecryptSymmetric(data, s)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "Invalid Passphrase")
|
||||
return crypto.PrivKey{}, errors.Wrap(err, "Invalid Passphrase")
|
||||
}
|
||||
key, err := crypto.PrivKeyFromBytes(private)
|
||||
return key, errors.Wrap(err, "Invalid Passphrase")
|
||||
|
||||
@@ -50,7 +50,7 @@ func TestSecretBox(t *testing.T) {
|
||||
// decoding with a different pass is an error
|
||||
pk, err := enc.Decrypt(b, "decode")
|
||||
require.NotNil(err)
|
||||
require.Nil(pk)
|
||||
require.True(pk.Empty())
|
||||
|
||||
// but decoding with the same passphrase gets us our key
|
||||
pk, err = enc.Decrypt(b, pass)
|
||||
|
||||
@@ -25,11 +25,11 @@ func (f GenFunc) Generate() crypto.PrivKey {
|
||||
}
|
||||
|
||||
func genEd25519() crypto.PrivKey {
|
||||
return crypto.GenPrivKeyEd25519()
|
||||
return crypto.GenPrivKeyEd25519().Wrap()
|
||||
}
|
||||
|
||||
func genSecp256() crypto.PrivKey {
|
||||
return crypto.GenPrivKeySecp256k1()
|
||||
return crypto.GenPrivKeySecp256k1().Wrap()
|
||||
}
|
||||
|
||||
func getGenerator(algo string) (Generator, error) {
|
||||
|
||||
Reference in New Issue
Block a user