From 0fe8784131f786de8fa4a52fe559eae0c32903ca Mon Sep 17 00:00:00 2001 From: Pauli Date: Mon, 31 Mar 2025 13:01:22 +1100 Subject: [PATCH] rand: avoid unused function warning for FreeBSD and NetBSD. The existing checks were not sufficiently version specific. Reviewed-by: Tom Cosgrove Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/27204) --- providers/implementations/rands/seeding/rand_unix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/providers/implementations/rands/seeding/rand_unix.c b/providers/implementations/rands/seeding/rand_unix.c index c3a5d8b3bf2..bd21acf2bcb 100644 --- a/providers/implementations/rands/seeding/rand_unix.c +++ b/providers/implementations/rands/seeding/rand_unix.c @@ -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. -- 2.47.2