fix vulnerability in zeroKey

This commit is contained in:
George Carder 2020-04-23 15:13:56 -07:00
parent 38aab0aa83
commit d88437cf10

View file

@ -495,8 +495,5 @@ func (ks *KeyStore) ImportPreSaleKey(keyJSON []byte, passphrase string) (account
// zeroKey zeroes a private key in memory. // zeroKey zeroes a private key in memory.
func zeroKey(k *ecdsa.PrivateKey) { func zeroKey(k *ecdsa.PrivateKey) {
b := k.D.Bits() k.D.SetUint64(uint64(0))
for i := range b {
b[i] = 0
}
} }