diff options
Diffstat (limited to '')
| -rw-r--r-- | snac.c | 5 |
1 files changed, 4 insertions, 1 deletions
| @@ -16,6 +16,7 @@ | |||
| 16 | #include "xs_set.h" | 16 | #include "xs_set.h" |
| 17 | #include "xs_time.h" | 17 | #include "xs_time.h" |
| 18 | #include "xs_glob.h" | 18 | #include "xs_glob.h" |
| 19 | #include "xs_random.h" | ||
| 19 | 20 | ||
| 20 | #include "snac.h" | 21 | #include "snac.h" |
| 21 | 22 | ||
| @@ -122,7 +123,9 @@ xs_str *hash_password(const char *uid, const char *passwd, const char *nonce) | |||
| 122 | xs *hash; | 123 | xs *hash; |
| 123 | 124 | ||
| 124 | if (nonce == NULL) { | 125 | if (nonce == NULL) { |
| 125 | d_nonce = xs_fmt("%08x", random()); | 126 | unsigned int r; |
| 127 | xs_rnd_buf(&r, sizeof(r)); | ||
| 128 | d_nonce = xs_fmt("%08x", r); | ||
| 126 | nonce = d_nonce; | 129 | nonce = d_nonce; |
| 127 | } | 130 | } |
| 128 | 131 | ||