diff options
| author | Pieter Wuille <[email protected]> | 2016-04-16 12:25:12 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2016-05-29 01:52:17 +0200 |
| commit | fa2637a3beb8677067015df3d9d7b394fa837c2f (patch) | |
| tree | 9325bb10a5fe3e220d040827b82f7da5b42fc346 /src/wallet/wallet.cpp | |
| parent | Merge #8108: Trivial: Remove unused local variable shadowing upper local (diff) | |
| download | discoin-fa2637a3beb8677067015df3d9d7b394fa837c2f.tar.xz discoin-fa2637a3beb8677067015df3d9d7b394fa837c2f.zip | |
Always require OS randomness when generating secret keys
Diffstat (limited to 'src/wallet/wallet.cpp')
| -rw-r--r-- | src/wallet/wallet.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 5d1a43119..da0d6f272 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -509,16 +509,14 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase) return false; CKeyingMaterial vMasterKey; - RandAddSeedPerfmon(); vMasterKey.resize(WALLET_CRYPTO_KEY_SIZE); - GetRandBytes(&vMasterKey[0], WALLET_CRYPTO_KEY_SIZE); + GetStrongRandBytes(&vMasterKey[0], WALLET_CRYPTO_KEY_SIZE); CMasterKey kMasterKey; - RandAddSeedPerfmon(); kMasterKey.vchSalt.resize(WALLET_CRYPTO_SALT_SIZE); - GetRandBytes(&kMasterKey.vchSalt[0], WALLET_CRYPTO_SALT_SIZE); + GetStrongRandBytes(&kMasterKey.vchSalt[0], WALLET_CRYPTO_SALT_SIZE); CCrypter crypter; int64_t nStartTime = GetTimeMillis(); @@ -3147,8 +3145,6 @@ bool CWallet::InitLoadWallet() if (fFirstRun) { // Create new keyUser and set as default key - RandAddSeedPerfmon(); - CPubKey newDefaultKey; if (walletInstance->GetKeyFromPool(newDefaultKey)) { walletInstance->SetDefaultKey(newDefaultKey); |