Merge pull request #3560 from gufe44/netbsd-rand-arc4random_buf-2.16

[Backport 2.16] Use arc4random_buf instead of rand on NetBSD
This commit is contained in:
Gilles Peskine 2020-08-13 15:27:53 +02:00 committed by GitHub
commit 9acf943b98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View file

@ -549,7 +549,7 @@ unsigned char *unhexify_alloc( const char *ibuf, size_t *olen )
*/
static int rnd_std_rand( void *rng_state, unsigned char *output, size_t len )
{
#if !defined(__OpenBSD__)
#if !defined(__OpenBSD__) && !defined(__NetBSD__)
size_t i;
if( rng_state != NULL )
@ -562,7 +562,7 @@ static int rnd_std_rand( void *rng_state, unsigned char *output, size_t len )
rng_state = NULL;
arc4random_buf( output, len );
#endif /* !OpenBSD */
#endif /* !OpenBSD && !NetBSD */
return( 0 );
}