In rand_cleanup_int(), don't go creating a default method
authorRichard Levitte <levitte@openssl.org>
Thu, 6 Apr 2017 08:24:55 +0000 (10:24 +0200)
committerRichard Levitte <levitte@openssl.org>
Thu, 6 Apr 2017 08:28:43 +0000 (10:28 +0200)
commit5006b37b31c5a520c3065048bd8aba8cc3ff128d
tree960e4ade63e2ddc70345819de8906aa3c4191683
parent5748e4dc3ab1cdde43ae6feecb106e3a41adcdf4
In rand_cleanup_int(), don't go creating a default method

If no default method was yet given, RAND_get_rand_method() will set it
up.  Doing so just to clean it away seems pretty silly, so instead,
use the default_RAND_meth variable directly.

This also clears a possible race condition where this will try to init
things, such as ERR or ENGINE when in the middle of a OPENSSL_cleanup.

Fixes #3128

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3136)
crypto/rand/rand_lib.c