summaryrefslogtreecommitdiff
path: root/source3/libsmb
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/libsmb
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/libsmb')
-rw-r--r--source3/libsmb/clientgen.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index bffce26294..1f2f746576 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -766,9 +766,11 @@ int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode)
accessmode |= 1;
}
+#if defined(O_SYNC)
if ((flags & O_SYNC) == O_SYNC) {
accessmode |= (1<<14);
}
+#endif /* O_SYNC */
bzero(cli->outbuf,smb_size);
bzero(cli->inbuf,smb_size);
@@ -1300,8 +1302,11 @@ BOOL cli_oem_change_password(struct cli_state *cli, char *user, char *new_passwo
/*
* Now setup the data area.
+ * We need to generate a random fill
+ * for this area to make it harder to
+ * decrypt. JRA.
*/
- memset(data, '\0', sizeof(data));
+ generate_random_buffer(data, sizeof(data), False);
fstrcpy( &data[512 - new_pw_len], new_password);
SIVAL(data, 512, new_pw_len);