From fafdbbf815ea44ca1813a4ab58547d487f6a3bfb Mon Sep 17 00:00:00 2001 From: default Date: Mon, 5 Jun 2023 18:29:25 +0200 Subject: Replaced usage of random() with xs_rnd_buf(). --- snac.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'snac.c') diff --git a/snac.c b/snac.c index 722af62..691c2e2 100644 --- a/snac.c +++ b/snac.c @@ -16,6 +16,7 @@ #include "xs_set.h" #include "xs_time.h" #include "xs_glob.h" +#include "xs_random.h" #include "snac.h" @@ -122,7 +123,9 @@ xs_str *hash_password(const char *uid, const char *passwd, const char *nonce) xs *hash; if (nonce == NULL) { - d_nonce = xs_fmt("%08x", random()); + unsigned int r; + xs_rnd_buf(&r, sizeof(r)); + d_nonce = xs_fmt("%08x", r); nonce = d_nonce; } -- cgit v1.2.3