mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-01-07 23:18:59 +01:00
Use arc4random_buf instead of rand on NetBSD
Avoid old implementation of rand returning numbers with cyclical lower bits. Allow tests to pass. Signed-off-by: gufe44 <gu981@protonmail.com>
This commit is contained in:
parent
a586099fd3
commit
3fa7c64edf
2 changed files with 5 additions and 5 deletions
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue