-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Randomizer: always use CSPRNG from OpenSSL
The Randomizer class provided an insecure mersenne twister PRNG as a convenience method to draw things like PINs and serial numbers from it. I changed this to always use a secure OpenSSL-based CSPRNG. Furthermore, the OpenSSL PRNG was insecurely seeded from the mersenne twister RNG. Fix this, by combining several input sources via a cryptographic hash function and seed OpenSSL from it. The code now tries to read 256 Bit from different sources and combines them, with SHA-512. When OpenSSL aims for 256 Bit security strength, seed it with at least 1.5x this security strength. Please note, that OpenSSL in typical configurations is automatically seeded and the seeding strategy here probably did no harm by accident in the past. Signed-off-by: Markus Theil <[email protected]>
- Loading branch information
Showing
3 changed files
with
146 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.