[openssl] OpenSSL_1_1_1-stable update

Dr. Paul Dale pauli at openssl.org
Tue Jun 29 22:46:32 UTC 2021


The branch OpenSSL_1_1_1-stable has been updated
       via  b58ac9f1e3f828b5c65c9edd5bb86603a4886a26 (commit)
      from  efac3f67637b7e9b89a924c246577e16445d6e04 (commit)


- Log -----------------------------------------------------------------
commit b58ac9f1e3f828b5c65c9edd5bb86603a4886a26
Author: David CARLIER <devnexen at gmail.com>
Date:   Mon Jun 28 09:55:22 2021 +0100

    apple getentropy removal
    
    backport of #15924
    
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    Reviewed-by: Paul Dale <pauli at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/15935)

-----------------------------------------------------------------------

Summary of changes:
 crypto/rand/rand_unix.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/crypto/rand/rand_unix.c b/crypto/rand/rand_unix.c
index ec6be791b3..eda0d5ae20 100644
--- a/crypto/rand/rand_unix.c
+++ b/crypto/rand/rand_unix.c
@@ -34,6 +34,9 @@
 #if defined(__OpenBSD__)
 # include <sys/param.h>
 #endif
+#if defined(__APPLE__)
+# include <CommonCrypto/CommonRandom.h>
+#endif
 
 #if defined(OPENSSL_SYS_UNIX) || defined(__DJGPP__)
 # include <sys/types.h>
@@ -378,6 +381,11 @@ static ssize_t syscall_random(void *buf, size_t buflen)
         if (errno != ENOSYS)
             return -1;
     }
+#  elif defined(__APPLE__)
+    if (CCRandomGenerateBytes(buf, buflen) == kCCSuccess)
+	    return (ssize_t)buflen;
+
+    return -1;
 #  else
     union {
         void *p;


More information about the openssl-commits mailing list