From d087545deb354f58431010253dc5170cef3e2bf3 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 1 Aug 2008 16:10:06 +0200 Subject: auth/ntlmssp: don't crash when the backend give no challenge metze (This used to be commit c01fee80a79cd9e0f7bb295333bb03bd37328d05) --- source4/auth/ntlmssp/ntlmssp_server.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/auth/ntlmssp') 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; } -- cgit