summaryrefslogtreecommitdiff
path: root/snac.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-06-05 18:29:25 +0200
committerdefault <nobody@localhost>2023-06-05 18:29:25 +0200
commitfafdbbf815ea44ca1813a4ab58547d487f6a3bfb (patch)
tree139aeaf983b3b634f4b3bdfa57bb63876bb2cf68 /snac.c
parente788a5bf8fde50cc8ba30390f829bb78e18add4d (diff)
Replaced usage of random() with xs_rnd_buf().
Diffstat (limited to 'snac.c')
-rw-r--r--snac.c5
1 files changed, 4 insertions, 1 deletions
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;
}