summaryrefslogtreecommitdiff
path: root/source3/smbd/password.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-04-20 22:43:54 +0000
committerJeremy Allison <jra@samba.org>1998-04-20 22:43:54 +0000
commitefb71742ca8ff9ec3211c5b3cf5d311fdceecd1c (patch)
treea153db84a0a571cbe2e49d591025e5c4659a3676 /source3/smbd/password.c
parentec6fde99ab739ff2c410e5459bba06b06d18b5dc (diff)
downloadsamba-efb71742ca8ff9ec3211c5b3cf5d311fdceecd1c.tar.gz
samba-efb71742ca8ff9ec3211c5b3cf5d311fdceecd1c.tar.bz2
samba-efb71742ca8ff9ec3211c5b3cf5d311fdceecd1c.zip
Makefile: Added genrand.o
clientgen.c: Changed to fill change password buffer with random stuff. password.c: Changed to get challenge from genrand.c server.c: Added #ifdef around O_SYNC. version.h: Changed to 1.9.19prealpha. genrand.c: New code to generate (hopefully) good random numbers for use in crypto challenges/session keys etc. PLEASE REVIEW THIS CODE AND SUGGEST IMPROVEMENTS !!!!!! Jeremy. (This used to be commit 608e98546392fd0aac9b33f4feac43615dbb4405)
Diffstat (limited to 'source3/smbd/password.c')
-rw-r--r--source3/smbd/password.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c
index bbd9f8b849..fe3ac5c765 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -45,6 +45,12 @@ Get the next challenge value - no repeats.
********************************************************************/
void generate_next_challenge(char *challenge)
{
+#if 0
+ /*
+ * Leave this ifdef'd out while we test
+ * the new crypto random number generator.
+ * JRA.
+ */
unsigned char buf[16];
static int counter = 0;
struct timeval tval;
@@ -59,7 +65,11 @@ void generate_next_challenge(char *challenge)
/* mash it up with md4 */
mdfour(buf, (unsigned char *)challenge, 8);
+#else
+ unsigned char buf[8];
+ generate_random_buffer(buf,8,False);
+#endif
memcpy(saved_challenge, buf, 8);
memcpy(challenge,buf,8);
challenge_sent = True;