s4:torture/smb2/session: require a signed session setup reauth response
authorRalph Boehme <slow@samba.org>
Fri, 9 Nov 2018 14:34:24 +0000 (15:34 +0100)
committerRalph Boehme <slow@samba.org>
Tue, 13 Nov 2018 10:13:03 +0000 (11:13 +0100)
All existing tests using this function require signing, so currently
this passes. A subsequent commit adds a test where neither client nor
server require signing and that's where this trap will explode.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13661

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/torture/smb2/session.c

index 65cc53ba33715bb3c11105157688dbec14a7837a..a088754ec006685f6af992243d91d45bf7af15eb 100644 (file)
@@ -1154,12 +1154,20 @@ static bool test_session_expire1i(struct torture_context *tctx,
                 */
                cli_credentials_invalidate_ccache(credentials, CRED_SPECIFIED);
 
+               if (!force_encryption) {
+                       smb2cli_session_require_signed_response(
+                               tree->session->smbXcli, true);
+               }
+
                torture_comment(tctx, "reauth => OK\n");
                status = smb2_session_setup_spnego(tree->session,
                                                   credentials,
                                                   0 /* previous_session_id */);
                torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
                                        "smb2_session_setup_spnego failed");
+
+               smb2cli_session_require_signed_response(
+                       tree->session->smbXcli, false);
        }
 
        ZERO_STRUCT(qfinfo.access_information.out);