From e6f2434fc000d7d5c17b705002075c23ad2ca414 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Tue, 5 Nov 2019 21:56:32 -0500 Subject: Use arc4random_buf --- bounce.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bounce.c b/bounce.c index bb7e59c..2ac9118 100644 --- a/bounce.c +++ b/bounce.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -47,8 +46,7 @@ static void hashPass(void) { char *pass = getpass("Password: "); byte rand[12]; - ssize_t len = getrandom(rand, sizeof(rand), 0); - if (len < 0) err(EX_OSERR, "getrandom"); + arc4random_buf(rand, sizeof(rand)); char salt[3 + BASE64_SIZE(sizeof(rand))] = "$6$"; base64(&salt[3], rand, sizeof(rand)); printf("%s\n", crypt(pass, salt)); -- cgit 1.4.1