diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-12-29 11:57:28 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-12-29 17:06:22 +0100 |
commit | c9b6ad25004caab854cf6301faa472bb5c890a71 (patch) | |
tree | d9f5cac23ec60076f87c8af0f5392348690a3636 /source3 | |
parent | fbb59b2dcac1ce4d952c17d010ebf3bcfca863cd (diff) | |
download | samba-c9b6ad25004caab854cf6301faa472bb5c890a71.tar.gz samba-c9b6ad25004caab854cf6301faa472bb5c890a71.tar.bz2 samba-c9b6ad25004caab854cf6301faa472bb5c890a71.zip |
s3:ntlmssp: change get_challange() to return NTSTATUS
metze
Diffstat (limited to 'source3')
-rw-r--r-- | source3/auth/auth_ntlmssp.c | 5 | ||||
-rw-r--r-- | source3/include/ntlmssp.h | 4 | ||||
-rw-r--r-- | source3/libsmb/ntlmssp.c | 11 |
3 files changed, 13 insertions, 7 deletions
diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c index f95a235909..4243a24ca7 100644 --- a/source3/auth/auth_ntlmssp.c +++ b/source3/auth/auth_ntlmssp.c @@ -28,13 +28,14 @@ * @return an 8 byte random challenge */ -static void auth_ntlmssp_get_challenge(const struct ntlmssp_state *ntlmssp_state, - uint8_t chal[8]) +static NTSTATUS auth_ntlmssp_get_challenge(const struct ntlmssp_state *ntlmssp_state, + uint8_t chal[8]) { AUTH_NTLMSSP_STATE *auth_ntlmssp_state = (AUTH_NTLMSSP_STATE *)ntlmssp_state->auth_context; auth_ntlmssp_state->auth_context->get_ntlm_challenge( auth_ntlmssp_state->auth_context, chal); + return NT_STATUS_OK; } /** diff --git a/source3/include/ntlmssp.h b/source3/include/ntlmssp.h index f30b53f094..d3de59835f 100644 --- a/source3/include/ntlmssp.h +++ b/source3/include/ntlmssp.h @@ -74,8 +74,8 @@ struct ntlmssp_state * @return 8 bytes of challenge data, determined by the server to be the challenge for NTLM authentication * */ - void (*get_challenge)(const struct ntlmssp_state *ntlmssp_state, - uint8_t challenge[8]); + NTSTATUS (*get_challenge)(const struct ntlmssp_state *ntlmssp_state, + uint8_t challenge[8]); /** * Callback to find if the challenge used by NTLM authentication may be modified diff --git a/source3/libsmb/ntlmssp.c b/source3/libsmb/ntlmssp.c index aaa5031951..7fffe7cea3 100644 --- a/source3/libsmb/ntlmssp.c +++ b/source3/libsmb/ntlmssp.c @@ -112,10 +112,11 @@ void debug_ntlmssp_flags(uint32 neg_flags) * */ -static void get_challenge(const struct ntlmssp_state *ntlmssp_state, - uint8_t chal[8]) +static NTSTATUS get_challenge(const struct ntlmssp_state *ntlmssp_state, + uint8_t chal[8]) { generate_random_buffer(chal, 8); + return NT_STATUS_OK; } /** @@ -493,6 +494,7 @@ static NTSTATUS ntlmssp_server_negotiate(struct ntlmssp_state *ntlmssp_state, const char *target_name; struct NEGOTIATE_MESSAGE negotiate; struct CHALLENGE_MESSAGE challenge; + NTSTATUS status; /* parse the NTLMSSP packet */ #if 0 @@ -525,7 +527,10 @@ 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 */ - ntlmssp_state->get_challenge(ntlmssp_state, cryptkey); + status = ntlmssp_state->get_challenge(ntlmssp_state, cryptkey); + if (!NT_STATUS_IS_OK(status)) { + return status; + } /* Check if we may set the challenge */ if (!ntlmssp_state->may_set_challenge(ntlmssp_state)) { |