<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">--- ./crypto/rand/rand_unix.c.orig	2021-08-24 06:38:47.000000000 -0700
+++ ./crypto/rand/rand_unix.c	2021-09-04 19:21:00.000000000 -0700
@@ -34,9 +34,6 @@
 #if defined(__OpenBSD__)
 # include &lt;sys/param.h&gt;
 #endif
-#if defined(__APPLE__)
-# include &lt;CommonCrypto/CommonRandom.h&gt;
-#endif
 
 #if defined(OPENSSL_SYS_UNIX) || defined(__DJGPP__)
 # include &lt;sys/types.h&gt;
@@ -381,7 +378,7 @@ static ssize_t syscall_random(void *buf,
         if (errno != ENOSYS)
             return -1;
     }
-#  elif defined(__APPLE__)
+#  elif defined(OPENSSL_APPLE_CRYPTO_RANDOM)
     if (CCRandomGenerateBytes(buf, buflen) == kCCSuccess)
 	    return (ssize_t)buflen;
 
--- ./include/crypto/rand.h.orig	2021-08-24 06:38:47.000000000 -0700
+++ ./include/crypto/rand.h	2021-09-04 19:21:00.000000000 -0700
@@ -20,6 +20,15 @@
 
 # include &lt;openssl/rand.h&gt;
 
+# if defined(__APPLE__) &amp;&amp; !defined(OPENSSL_NO_APPLE_CRYPTO_RANDOM)
+#  if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ &gt;= 101200 || \
+      __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 80000
+#   define OPENSSL_APPLE_CRYPTO_RANDOM 1
+#   include &lt;CommonCrypto/CommonCryptoError.h&gt;
+#   include &lt;CommonCrypto/CommonRandom.h&gt;
+#  endif
+# endif
+
 /* forward declaration */
 typedef struct rand_pool_st RAND_POOL;
 
</pre></body></html>