]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
rand: avoid unused function warning for FreeBSD and NetBSD.
authorPauli <ppzgs1@gmail.com>
Mon, 31 Mar 2025 02:01:22 +0000 (13:01 +1100)
committerTomas Mraz <tomas@openssl.org>
Tue, 1 Apr 2025 13:09:30 +0000 (15:09 +0200)
The existing checks were not sufficiently version specific.

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27204)

providers/implementations/rands/seeding/rand_unix.c

index c3a5d8b3bf245b0e89766face53f4e1190de027c..bd21acf2bcb3a722824f927c205894db1f052793 100644 (file)
@@ -211,7 +211,9 @@ void ossl_rand_pool_keep_random_devices_open(int keep)
 #   define OPENSSL_RAND_SEED_DEVRANDOM
 #  endif
 
-#  if (defined(__FreeBSD__) || defined(__NetBSD__)) && defined(KERN_ARND)
+#  if ((defined(__FreeBSD__) && __FreeBSD_version < 1200061)        \
+       || (defined(__NetBSD__) && __NetBSD_Version < 1000000000))   \
+      && defined(KERN_ARND)
 /*
  * sysctl_random(): Use sysctl() to read a random number from the kernel
  * Returns the number of bytes returned in buf on success, -1 on failure.