mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
util: add UTI_GetRandomBytesUrandom()
This function always uses /dev/urandom, even if arc4random() is available, and is intended for generating long-term keys.
This commit is contained in:
7
util.h
7
util.h
@@ -148,7 +148,12 @@ extern int UTI_CheckDirPermissions(const char *path, mode_t perm, uid_t uid, gid
|
||||
/* Set process user/group IDs and drop supplementary groups */
|
||||
extern void UTI_DropRoot(uid_t uid, gid_t gid);
|
||||
|
||||
/* Fill buffer with random bytes */
|
||||
/* Fill buffer with random bytes from /dev/urandom */
|
||||
extern void UTI_GetRandomBytesUrandom(void *buf, unsigned int len);
|
||||
|
||||
/* Fill buffer with random bytes from /dev/urandom or a faster source if it's
|
||||
available (e.g. arc4random()), which may not necessarily be suitable for
|
||||
generating long-term keys */
|
||||
extern void UTI_GetRandomBytes(void *buf, unsigned int len);
|
||||
|
||||
/* Macros to get maximum and minimum of two values */
|
||||
|
||||
Reference in New Issue
Block a user