summaryrefslogtreecommitdiffstats
path: root/source3/libsmb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-02-19 23:41:48 +0100
committerVolker Lendecke <vl@samba.org>2009-02-21 14:04:14 +0100
commit4aed9abbf84deb47e7a3aec025268a3c1e6b29bb (patch)
treed11cd47acd6bcf3617fd2075c02ebed8ef653146 /source3/libsmb
parente9467ff26ed429dbb2d4249da5bedf545664253b (diff)
downloadsamba-4aed9abbf84deb47e7a3aec025268a3c1e6b29bb.tar.gz
samba-4aed9abbf84deb47e7a3aec025268a3c1e6b29bb.tar.xz
samba-4aed9abbf84deb47e7a3aec025268a3c1e6b29bb.zip
Remove the static "chal" from ntlmssp.c:get_challenge()
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/ntlmssp.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/source3/libsmb/ntlmssp.c b/source3/libsmb/ntlmssp.c
index cc13476935c..0764f97d859 100644
--- a/source3/libsmb/ntlmssp.c
+++ b/source3/libsmb/ntlmssp.c
@@ -110,12 +110,10 @@ void debug_ntlmssp_flags(uint32 neg_flags)
*
*/
-static const uint8 *get_challenge(const struct ntlmssp_state *ntlmssp_state)
+static void get_challenge(const struct ntlmssp_state *ntlmssp_state,
+ uint8_t chal[8])
{
- static uchar chal[8];
- generate_random_buffer(chal, sizeof(chal));
-
- return chal;
+ generate_random_buffer(chal, 8);
}
/**
@@ -517,7 +515,7 @@ static NTSTATUS ntlmssp_server_negotiate(struct ntlmssp_state *ntlmssp_state,
char *dnsdomname = NULL;
uint32 neg_flags = 0;
uint32 ntlmssp_command, chal_flags;
- const uint8 *cryptkey;
+ uint8_t cryptkey[8];
const char *target_name;
/* parse the NTLMSSP packet */
@@ -541,7 +539,7 @@ static NTSTATUS ntlmssp_server_negotiate(struct ntlmssp_state *ntlmssp_state,
ntlmssp_handle_neg_flags(ntlmssp_state, neg_flags, lp_lanman_auth());
/* Ask our caller what challenge they would like in the packet */
- cryptkey = ntlmssp_state->get_challenge(ntlmssp_state);
+ ntlmssp_state->get_challenge(ntlmssp_state, cryptkey);
/* Check if we may set the challenge */
if (!ntlmssp_state->may_set_challenge(ntlmssp_state)) {