diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2006-02-28 13:12:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:52:09 -0500 |
commit | aa04388943fe5d7d8c873a6ee8a4cc9af2491532 (patch) | |
tree | 8073b268875c22e8e0785ddffef42fcf3af3dac1 /source4/lib/util/genrand.c | |
parent | 4d3cc7384338fe2182a2029c2e6d2fcca2ec8813 (diff) | |
download | samba-aa04388943fe5d7d8c873a6ee8a4cc9af2491532.tar.gz samba-aa04388943fe5d7d8c873a6ee8a4cc9af2491532.tar.bz2 samba-aa04388943fe5d7d8c873a6ee8a4cc9af2491532.zip |
r13752: Add doxyfile and fix formatting of comments. Current output is available at http://samba.org/~jelmer/util-api/
(This used to be commit 90812203df151a5e62394306827c72adfe13c63c)
Diffstat (limited to 'source4/lib/util/genrand.c')
-rw-r--r-- | source4/lib/util/genrand.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/source4/lib/util/genrand.c b/source4/lib/util/genrand.c index 1149314d0b..a264ac4e31 100644 --- a/source4/lib/util/genrand.c +++ b/source4/lib/util/genrand.c @@ -25,15 +25,20 @@ #include "system/filesys.h" #include "lib/crypto/crypto.h" +/** + * @file + * @brief Random number generation + */ + static unsigned char hash[258]; static uint32_t counter; static BOOL done_reseed = False; static void (*reseed_callback)(int *newseed); -/**************************************************************** +/** Copy any user given reseed data. -*****************************************************************/ +**/ void set_rand_reseed_callback(void (*fn)(int *)) { @@ -196,9 +201,9 @@ static int do_reseed(BOOL use_fd, int fd) return -1; } -/* +/** Interface to the (hopefully) good crypto random number generator. -*/ +**/ void generate_random_buffer(uint8_t *out, int len) { static int urand_fd = -1; @@ -242,9 +247,9 @@ void generate_random_buffer(uint8_t *out, int len) } } -/* +/** generate a single random uint32_t -*/ +**/ uint32_t generate_random(void) { uint8_t v[4]; @@ -253,9 +258,9 @@ uint32_t generate_random(void) } -/* +/** very basic password quality checker -*/ +**/ BOOL check_password_quality(const char *s) { int has_digit=0, has_capital=0, has_lower=0; @@ -273,9 +278,9 @@ BOOL check_password_quality(const char *s) return has_digit && has_lower && has_capital; } -/******************************************************************* +/** Use the random number generator to generate a random string. -********************************************************************/ +**/ char *generate_random_str_list(TALLOC_CTX *mem_ctx, size_t len, const char *list) { |