s3:smbd: remove dead code from smbd_smb2_request_dispatch()
authorStefan Metzmacher <metze@samba.org>
Tue, 13 Jul 2021 14:37:42 +0000 (16:37 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 15 Jul 2021 00:06:31 +0000 (00:06 +0000)
We have '} else if (signing_required || (flags & SMB2_HDR_FLAG_SIGNED)) {'
before...

Use 'git show -U52' to see the whole story...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/smb2_server.c

index 991a336855a7481d194e8d872a5386cd66341166..a2f2447595df434daf47fe497856fd1651b40c7b 100644 (file)
@@ -2767,9 +2767,6 @@ static void smb2srv_update_crypto_flags(struct smbd_smb2_request *req,
                /* Unencrypted packet, can be signed */
                if (req->do_signing) {
                        sign_flag = SMBXSRV_PROCESSED_SIGNED_PACKET;
-               } else if (opcode == SMB2_OP_CANCEL) {
-                       /* Cancel requests are allowed to skip signing */
-                       sign_flag &= ~SMBXSRV_PROCESSED_UNSIGNED_PACKET;
                }
        }
 
@@ -3130,8 +3127,6 @@ NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req)
                if (!NT_STATUS_IS_OK(session_status)) {
                        return smbd_smb2_request_error(req, session_status);
                }
-       } else if (opcode == SMB2_OP_CANCEL) {
-               /* Cancel requests are allowed to skip the signing */
        } else if (opcode == SMB2_OP_IOCTL) {
                /*
                 * Some special IOCTL calls don't require
@@ -3168,13 +3163,6 @@ NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req)
                        call = &_root_ioctl_call;
                        break;
                }
-       } else if (signing_required) {
-               /*
-                * If signing is required we try to sign
-                * a possible error response
-                */
-               req->do_signing = true;
-               return smbd_smb2_request_error(req, NT_STATUS_ACCESS_DENIED);
        }
 
        if (flags & SMB2_HDR_FLAG_CHAINED) {