crypto/mem.c: on Windows, use rand() instead of random()

Windows doesn't provide random().  In this particular case, our
requirements on the quality of randomness isn't high, so we don't
need to care how good randomness rand() does or doesn't provide.

Fixes #3778

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3779)
This commit is contained in:
Richard Levitte 2017-06-27 11:25:03 +02:00
parent eed3ec9047
commit afe9bba749

View file

@ -111,6 +111,14 @@ static void parseit(void)
md_failstring = semi;
}
/*
* Windows doesn't have random(), but it has rand()
* Some rand() implementations aren't good, but we're not
* dealing with secure randomness here.
*/
#ifdef _WIN32
# define random() rand()
#endif
/*
* See if the current malloc should fail.
*/