mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
accounts/keystore: clear decrypted key after use (#33090)
This commit is contained in:
parent
fa16c89bfd
commit
488d987fc4
1 changed files with 2 additions and 0 deletions
|
|
@ -418,6 +418,7 @@ func (ks *KeyStore) Export(a accounts.Account, passphrase, newPassphrase string)
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer zeroKey(key.PrivateKey)
|
||||
var N, P int
|
||||
if store, ok := ks.storage.(*keyStorePassphrase); ok {
|
||||
N, P = store.scryptN, store.scryptP
|
||||
|
|
@ -477,6 +478,7 @@ func (ks *KeyStore) Update(a accounts.Account, passphrase, newPassphrase string)
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer zeroKey(key.PrivateKey)
|
||||
return ks.storage.StoreKey(a.URL.Path, key, newPassphrase)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue