From: Richard Levitte Date: Tue, 27 Jun 2017 09:25:03 +0000 (+0200) Subject: crypto/mem.c: on Windows, use rand() instead of random() X-Git-Tag: OpenSSL_1_1_1-pre1~1185 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=afe9bba749b9fd897b7e7d416d904852d867d2c2 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 (Merged from https://github.com/openssl/openssl/pull/3779) --- diff --git a/crypto/mem.c b/crypto/mem.c index 0584814f73..aa5ac56b47 100644 --- a/crypto/mem.c +++ b/crypto/mem.c @@ -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. */