1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s4:torture: let smb2.session.bind_negative_* also test without session keys

This checks the result of a 2nd session setup without the BIND flags
and also without signing being already enabled.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Stefan Metzmacher 2021-06-10 16:03:15 +00:00
parent e25a9e8f4e
commit 66673f08f7
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,11 @@
^samba3.smb2.session.*bind_negative_smb3encGtoC
^samba3.smb2.session.*ntlm.bind_negative_smb202.ad_dc
^samba3.smb2.session.*ntlm.bind_negative_smb210.ad_dc
^samba3.smb2.session.*ntlm.bind_negative_smb2to3.ad_dc
^samba3.smb2.session.*ntlm.bind_negative_smb3to2.ad_dc
^samba3.smb2.session.*ntlm.bind_negative_smb3to3.ad_dc
^samba3.smb2.session.*krb5.bind_negative_smb202.ad_dc
^samba3.smb2.session.*krb5.bind_negative_smb210.ad_dc
^samba3.smb2.session.*krb5.bind_negative_smb2to3.ad_dc
^samba3.smb2.session.*krb5.bind_negative_smb3to2.ad_dc
^samba3.smb2.session.*krb5.bind_negative_smb3to3.ad_dc

View File

@ -2514,6 +2514,8 @@ static bool test_session_bind_negative_smbXtoX(struct torture_context *tctx,
struct smb2_tree *tree2_0 = NULL;
struct smb2_transport *transport2 = NULL;
struct smb2_session *session1_2 = NULL;
uint64_t session1_id = 0;
uint16_t session1_flags = 0;
status = smb2_connect(tctx,
host,
@ -2530,6 +2532,8 @@ static bool test_session_bind_negative_smbXtoX(struct torture_context *tctx,
torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
"smb2_connect options1 failed");
session1_1 = tree1->session;
session1_id = smb2cli_session_current_id(session1_1->smbXcli);
session1_flags = smb2cli_session_get_flags(session1_1->smbXcli);
/* Add some random component to the file name. */
snprintf(fname, sizeof(fname), "%s_%s.dat",
@ -2611,6 +2615,25 @@ static bool test_session_bind_negative_smbXtoX(struct torture_context *tctx,
"smb2_session_setup_spnego failed");
TALLOC_FREE(session1_2);
/*
* ... and we should also check the status without any existing
* session keys.
*/
session1_2 = smb2_session_init(transport2,
lpcfg_gensec_settings(tctx, tctx->lp_ctx),
tree2_0);
torture_assert(tctx, session1_2 != NULL, "smb2_session_channel failed");
talloc_steal(tree2_0->session, transport2);
smb2cli_session_set_id_and_flags(session1_2->smbXcli,
session1_id, session1_flags);
status = smb2_session_setup_spnego(session1_2,
credentials,
0 /* previous_session_id */);
torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_USER_SESSION_DELETED, ret, done,
"smb2_session_setup_spnego failed");
TALLOC_FREE(session1_2);
/* Check the initial session is still alive */
ZERO_STRUCT(qfinfo1);
qfinfo1.generic.level = RAW_FILEINFO_POSITION_INFORMATION;