Always require OS randomness when generating secret keys

This commit is contained in:
Pieter Wuille
2016-04-16 12:25:12 +02:00
parent a80de15113
commit fa2637a3be
7 changed files with 59 additions and 17 deletions

View File

@@ -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;