mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
darwin platform replacing getentropy usage by platform api instead.
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15924)
This commit is contained in:
parent
19c0b46b83
commit
f0b9e75e4f
@ -40,6 +40,9 @@
|
|||||||
# include <sys/param.h>
|
# include <sys/param.h>
|
||||||
# include <sys/random.h>
|
# include <sys/random.h>
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
# include <CommonCrypto/CommonRandom.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (defined(OPENSSL_SYS_UNIX) && !defined(OPENSSL_SYS_VXWORKS)) \
|
#if (defined(OPENSSL_SYS_UNIX) && !defined(OPENSSL_SYS_VXWORKS)) \
|
||||||
|| defined(__DJGPP__)
|
|| defined(__DJGPP__)
|
||||||
@ -366,6 +369,12 @@ static ssize_t syscall_random(void *buf, size_t buflen)
|
|||||||
if (errno != ENOSYS)
|
if (errno != ENOSYS)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
# elif defined(__APPLE__)
|
||||||
|
|
||||||
|
if (CCRandomGenerateBytes(buf, buflen) == kCCSuccess)
|
||||||
|
return (ssize_t)buflen;
|
||||||
|
|
||||||
|
return -1;
|
||||||
# else
|
# else
|
||||||
union {
|
union {
|
||||||
void *p;
|
void *p;
|
||||||
|
Loading…
Reference in New Issue
Block a user