diff options
author | default <nobody@localhost> | 2023-06-05 18:29:25 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-06-05 18:29:25 +0200 |
commit | fafdbbf815ea44ca1813a4ab58547d487f6a3bfb (patch) | |
tree | 139aeaf983b3b634f4b3bdfa57bb63876bb2cf68 /snac.c | |
parent | e788a5bf8fde50cc8ba30390f829bb78e18add4d (diff) |
Replaced usage of random() with xs_rnd_buf().
Diffstat (limited to 'snac.c')
-rw-r--r-- | snac.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; } |