Browse Source

Darwin platform allows to build on releases before Yosemite/ios 8.

backport #16409

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16418)
master^2
David Carlier 1 month ago
committed by Tomas Mraz
parent
commit
c023d98dcf
2 changed files with 11 additions and 5 deletions
  1. +10
    -0
      include/crypto/rand.h
  2. +1
    -5
      providers/implementations/rands/seeding/rand_unix.c

+ 10
- 0
include/crypto/rand.h View File

@ -22,6 +22,16 @@
# include <openssl/rand.h>
# include "crypto/rand_pool.h"
# if defined(__APPLE__) && !defined(OPENSSL_NO_APPLE_CRYPTO_RANDOM)
# include <Availability.h>
# if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000) || \
(defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000)
# define OPENSSL_APPLE_CRYPTO_RANDOM 1
# include <CommonCrypto/CommonCryptoError.h>
# include <CommonCrypto/CommonRandom.h>
# endif
# endif
/*
* Defines related to seed sources
*/


+ 1
- 5
providers/implementations/rands/seeding/rand_unix.c View File

@ -40,10 +40,6 @@
# include <sys/param.h>
# include <sys/random.h>
#endif
#if defined(__APPLE__)
# include <CommonCrypto/CommonCryptoError.h>
# include <CommonCrypto/CommonRandom.h>
#endif
#if (defined(OPENSSL_SYS_UNIX) && !defined(OPENSSL_SYS_VXWORKS)) \
|| defined(__DJGPP__)
@ -370,7 +366,7 @@ static ssize_t syscall_random(void *buf, size_t buflen)
if (errno != ENOSYS)
return -1;
}
# elif defined(__APPLE__)
# elif defined(OPENSSL_APPLE_CRYPTO_RANDOM)
if (CCRandomGenerateBytes(buf, buflen) == kCCSuccess)
return (ssize_t)buflen;


Loading…
Cancel
Save