diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-04-16 12:14:07 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-04-16 12:54:54 +0200 |
commit | 66d7553b0e008601846c1fc7b3a82052cbb5d66d (patch) | |
tree | ae33c0b9a8087d883a7ec9f76ac0e624cedc3532 /source3 | |
parent | 92483eee254ef6844fe88abe1e64f67033a1ea2d (diff) | |
download | samba-66d7553b0e008601846c1fc7b3a82052cbb5d66d.tar.gz samba-66d7553b0e008601846c1fc7b3a82052cbb5d66d.tar.bz2 samba-66d7553b0e008601846c1fc7b3a82052cbb5d66d.zip |
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
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/cliconnect.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 9d4e4e1f99..6e057a5fef 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -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); |