Skip to content

Commit

Permalink
RAND_pseudo_bytes() is deprecated in openssl 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gstrauss committed Dec 5, 2016
1 parent f9737e5 commit 64a7b64
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rand.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,12 @@ int li_rand (void)
{
/* randomness *is not* cryptographically strong */
/* (attempt to use better mechanisms to replace the more portable rand()) */
#ifdef USE_OPENSSL
#ifdef USE_OPENSSL /* (RAND_pseudo_bytes() is deprecated in openssl 1.1.0) */
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
int i;
if (-1 != RAND_pseudo_bytes((unsigned char *)&i, sizeof(i))) return i;
#endif
#endif
#ifdef HAVE_ARC4RANDOM_BUF
return (int)arc4random();
#elif defined(HAVE_SRANDOM)
Expand Down

0 comments on commit 64a7b64

Please sign in to comment.