mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Always require OS randomness when generating secret keys
This commit is contained in:
@@ -124,9 +124,8 @@ bool CKey::Check(const unsigned char *vch) {
|
||||
}
|
||||
|
||||
void CKey::MakeNewKey(bool fCompressedIn) {
|
||||
RandAddSeedPerfmon();
|
||||
do {
|
||||
GetRandBytes(vch, sizeof(vch));
|
||||
GetStrongRandBytes(vch, sizeof(vch));
|
||||
} while (!Check(vch));
|
||||
fValid = true;
|
||||
fCompressed = fCompressedIn;
|
||||
|
||||
Reference in New Issue
Block a user