Add tests for arc4random_buf() and an implementation for those without.

This commit is contained in:
Todd C. Miller
2020-01-30 13:12:25 -07:00
parent df2e3f7c7f
commit dc45c4d4ea
7 changed files with 116 additions and 4 deletions

View File

@@ -148,7 +148,6 @@ _rs_rekey(unsigned char *dat, size_t datlen)
rs_have = sizeof(rs_buf) - KEYSZ - IVSZ;
}
#ifdef notdef
static inline void
_rs_random_buf(void *_buf, size_t n)
{
@@ -171,7 +170,6 @@ _rs_random_buf(void *_buf, size_t n)
_rs_rekey(NULL, 0);
}
}
#endif
static inline void
_rs_random_u32(uint32_t *val)
@@ -198,7 +196,6 @@ sudo_arc4random(void)
return val;
}
#ifdef notdef
void
sudo_arc4random_buf(void *buf, size_t n)
{
@@ -206,6 +203,5 @@ sudo_arc4random_buf(void *buf, size_t n)
_rs_random_buf(buf, n);
_ARC4_UNLOCK();
}
#endif
#endif /* HAVE_ARC4RANDOM */