1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-08 04:58:40 +03:00

s3:libsmb: fix anonymous session setups against windows servers

Windows server doesn't set the SMB2_SESSION_FLAG_IS_GUEST nor
SMB2_SESSION_FLAG_IS_NULL flag.

This fix makes sure we don't try to verify a signature on the
final session setup response.

metze
This commit is contained in:
Stefan Metzmacher 2012-04-16 12:14:07 +02:00
parent 92483eee25
commit 66d7553b0e

View File

@ -1710,6 +1710,22 @@ static void cli_session_setup_ntlmssp_done(struct tevent_req *subreq)
if (cli_state_protocol(state->cli) >= PROTOCOL_SMB2_02) {
struct smbXcli_session *session = state->cli->smb2.session;
if (state->ntlmssp_state->nt_hash == NULL) {
/*
* Windows server does not set the
* SMB2_SESSION_FLAG_IS_GUEST nor
* SMB2_SESSION_FLAG_IS_NULL flag.
*
* This fix makes sure we do not try
* to verify a signature on the final
* session setup response.
*/
TALLOC_FREE(state->ntlmssp_state);
tevent_req_done(req);
return;
}
status = smb2cli_session_set_session_key(session,
state->ntlmssp_state->session_key,
recv_iov);