summaryrefslogtreecommitdiff
path: root/source4/lib/genrand.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/genrand.c')
-rw-r--r--source4/lib/genrand.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/source4/lib/genrand.c b/source4/lib/genrand.c
index e11f37e0e9..aab42864e0 100644
--- a/source4/lib/genrand.c
+++ b/source4/lib/genrand.c
@@ -192,10 +192,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;
@@ -240,6 +239,17 @@ void generate_random_buffer(uint8_t *out, int len)
}
/*
+ generate a single random uint32_t
+*/
+uint32_t generate_random(void)
+{
+ uint8_t v[4];
+ generate_random_buffer(v, 4);
+ return IVAL(v, 0);
+}
+
+
+/*
very basic password quality checker
*/
BOOL check_password_quality(const char *s)