summaryrefslogtreecommitdiff
path: root/source4/lib/genrand.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-21 13:13:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:04 -0500
commit6f0aef31cdfa9b486d1f2e0f097e071830f5600d (patch)
tree01891cccf49ab3bde362968bf10af93796c20107 /source4/lib/genrand.c
parent757a063a134ab466f437e60b1eed5215b992d80c (diff)
downloadsamba-6f0aef31cdfa9b486d1f2e0f097e071830f5600d.tar.gz
samba-6f0aef31cdfa9b486d1f2e0f097e071830f5600d.tar.bz2
samba-6f0aef31cdfa9b486d1f2e0f097e071830f5600d.zip
r4898: - removed the unused wins_srv_*() code
- expanded the generic async name resolver to try multiple methods - added wins resolutions to the list of methods tried - fixed up the random trn id generation to use the good random generator (This used to be commit 266fd2751c01808e5a18d4094032af50554ceb7a)
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)