/* fix the bufinfo */
smbsrv_setup_bufinfo(req);
- if (!smbsrv_signing_check_incoming(req)) {
- smbsrv_send_error(req, NT_STATUS_ACCESS_DENIED);
- return NT_STATUS_OK;
- }
-
command = CVAL(req->in.hdr, HDR_COM);
switch_message(command, req);
return NT_STATUS_OK;
errno = 0;
+ flags = smb_messages[type].flags;
+
+ if (!smbsrv_signing_check_incoming(req, (flags & SIGNING_NO_REPLY))) {
+ smbsrv_send_error(req, NT_STATUS_ACCESS_DENIED);
+ return;
+ }
+
if (smb_messages[type].fn == NULL) {
DEBUG(0,("Unknown message type %d!\n",type));
smbsrv_reply_unknown(req);
return;
}
- flags = smb_messages[type].flags;
-
req->tcon = smbsrv_smb_tcon_find(smb_conn, SVAL(req->in.hdr,HDR_TID), req->request_time);
if (!req->session) {
DEBUG(5,("switch message %s (task_id %u)\n",
smb_fn_name(type), (unsigned)req->smb_conn->connection->server_id.id));
- /* this must be called before we do any reply */
- if (flags & SIGNING_NO_REPLY) {
- smbsrv_signing_no_reply(req);
- }
-
/* see if the vuid is valid */
if ((flags & NEED_SESS) && !req->session) {
status = NT_STATUS_DOS(ERRSRV, ERRbaduid);
}
/* Force check of the request packet, now we know the session key */
- if (!smbsrv_signing_check_incoming(req)) {
+ if (!smbsrv_signing_check_incoming(req, false)) {
status = NT_STATUS_ACCESS_DENIED;
goto failed;
}
if (NT_STATUS_IS_OK(skey_status) &&
smbsrv_setup_signing(req->smb_conn, &session_key, NULL)) {
/* Force check of the request packet, now we know the session key */
- if (!smbsrv_signing_check_incoming(req)) {
+ if (!smbsrv_signing_check_incoming(req, false)) {
status = NT_STATUS_ACCESS_DENIED;
goto failed;
}
* @return false if we had an established signing connection
* which had a back checksum, true otherwise
*/
-bool smbsrv_signing_check_incoming(struct smbsrv_request *req)
+bool smbsrv_signing_check_incoming(struct smbsrv_request *req,
+ bool single_increment)
{
bool good;
req_signing_alloc_seq_num(req);
+ if (single_increment) {
+ smbsrv_signing_no_reply(req);
+ }
switch (req->smb_conn->signing.signing_state)
{