From aa04388943fe5d7d8c873a6ee8a4cc9af2491532 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 28 Feb 2006 13:12:39 +0000 Subject: 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) --- source4/lib/util/genrand.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'source4/lib/util/genrand.c') 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) { -- cgit