Add crypto_rand unit tests to check for predictable values
Add unit tests that check for common RNG failure modes, such as returning all zeroes, identical values, or incrementing values (OpenSSL's rand_predictable feature).
See my branch rand-failure-modes, it's based on bug17686_v2_027 in #17686 (moved). https://github.com/teor2345/tor.git
As well as doing these checks during unit tests, we could also do these checks every time we reseed OpenSSL's PRNG. (With an appropriately large buffer so that the chance of failure during normal operation is astronomically improbable, or at least less probable than a bit-flip in the return value.)
In particular, OpenSSL's rand_predictable feature concerns me - we currently don't check if Tor is run against an OpenSSL with it on.