summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-08-01 16:10:06 +0200
committerStefan Metzmacher <metze@samba.org>2008-08-01 16:10:59 +0200
commitd087545deb354f58431010253dc5170cef3e2bf3 (patch)
treefc7c7a129c4cac439dca8eaefc17db177fc7aeaf
parentf1cdce59632b893be89f784f2fb41b28f3a87170 (diff)
downloadsamba-d087545deb354f58431010253dc5170cef3e2bf3.tar.gz
samba-d087545deb354f58431010253dc5170cef3e2bf3.tar.xz
samba-d087545deb354f58431010253dc5170cef3e2bf3.zip
auth/ntlmssp: don't crash when the backend give no challenge
metze (This used to be commit c01fee80a79cd9e0f7bb295333bb03bd37328d05)
-rw-r--r--source4/auth/ntlmssp/ntlmssp_server.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/auth/ntlmssp/ntlmssp_server.c b/source4/auth/ntlmssp/ntlmssp_server.c
index dfc5940d99..838596ee98 100644
--- a/source4/auth/ntlmssp/ntlmssp_server.c
+++ b/source4/auth/ntlmssp/ntlmssp_server.c
@@ -157,6 +157,10 @@ NTSTATUS ntlmssp_server_negotiate(struct gensec_security *gensec_security,
/* Ask our caller what challenge they would like in the packet */
cryptkey = gensec_ntlmssp_state->get_challenge(gensec_ntlmssp_state);
+ if (!cryptkey) {
+ DEBUG(1, ("ntlmssp_server_negotiate: backend doesn't give a challenge\n"));
+ return NT_STATUS_INTERNAL_ERROR;
+ }
/* Check if we may set the challenge */
if (!gensec_ntlmssp_state->may_set_challenge(gensec_ntlmssp_state)) {
@@ -614,6 +618,8 @@ static const uint8_t *auth_ntlmssp_get_challenge(const struct gensec_ntlmssp_sta
status = auth_get_challenge(gensec_ntlmssp_state->auth_context, &chal);
if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(1, ("auth_ntlmssp_get_challenge: failed to get challenge: %s\n",
+ nt_errstr(status)));
return NULL;
}