rand_unix.c: Only enable hack for old FreeBSD versions on FreeBSD
authornia <nia@netbsd.org>
Thu, 30 Apr 2020 13:42:09 +0000 (14:42 +0100)
committerMatt Caswell <matt@openssl.org>
Mon, 4 May 2020 07:55:47 +0000 (08:55 +0100)
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11689)

crypto/rand/rand_unix.c

index 6b6cc78f80cc5d7ffde47ff07ba36d5abaac401f..c9ee01f1b13844a1e82c0b4125faa25f11109b1f 100644 (file)
@@ -227,10 +227,12 @@ static ssize_t sysctl_random(char *buf, size_t buflen)
      * when the sysctl returns long and we want to request something not a
      * multiple of longs, which should never be the case.
      */
+#if   defined(__FreeBSD__)
     if (!ossl_assert(buflen % sizeof(long) == 0)) {
         errno = EINVAL;
         return -1;
     }
+#endif
 
     /*
      * On NetBSD before 4.0 KERN_ARND was an alias for KERN_URND, and only