Don't use RDRAND if told not to
authorMatt Caswell <matt@openssl.org>
Thu, 4 Feb 2016 15:24:06 +0000 (15:24 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 4 Feb 2016 23:09:48 +0000 (23:09 +0000)
Ensure we respect OPENSSL_NO_RDRAND

Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/rand/md_rand.c

index 2b8abce370857ec9b7a434bdd6da337b53f6834f..9b6b0b56f9c47095febc2dbb7082e719cb449760 100644 (file)
@@ -686,7 +686,8 @@ static int rand_status(void)
 
 #if (defined(__i386)   || defined(__i386__)   || defined(_M_IX86) || \
      defined(__x86_64) || defined(__x86_64__) || \
-     defined(_M_AMD64) || defined (_M_X64)) && defined(OPENSSL_CPUID_OBJ)
+     defined(_M_AMD64) || defined (_M_X64)) && defined(OPENSSL_CPUID_OBJ) \
+     && !defined(OPENSSL_NO_RDRAND)
 
 # define RDRAND_CALLS    4