Remove ifndef FIPS_MODE from rand_unix.c
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Wed, 4 Sep 2019 09:50:54 +0000 (11:50 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Thu, 5 Sep 2019 06:25:18 +0000 (08:25 +0200)
This will never be the case for 1.1.1 so removed.

Fixes: comment 1 of #9757
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9762)

crypto/rand/rand_unix.c

index e57b6dd893179c8e3fa2934378c0a28aa78444e9..d1183603666c020db6b73fa68013862b782a7cb8 100644 (file)
@@ -364,12 +364,10 @@ static int keep_random_devices_open = 1;
 #   if defined(__linux) && defined(DEVRANDOM_WAIT)
 static void *shm_addr;
 
-#    if !defined(FIPS_MODE)
 static void cleanup_shm(void)
 {
     shmdt(shm_addr);
 }
-#    endif
 
 /*
  * Ensure that the system randomness source has been adequately seeded.
@@ -435,11 +433,8 @@ static int wait_random_seeded(void)
              * If this call fails, it isn't a big problem.
              */
             shm_addr = shmat(shm_id, NULL, SHM_RDONLY);
-#    ifndef FIPS_MODE
-            /* TODO 3.0: The FIPS provider doesn't have OPENSSL_atexit */
             if (shm_addr != (void *)-1)
                 OPENSSL_atexit(&cleanup_shm);
-#    endif
         }
     }
     return seeded;