From 8b5850226175777de0178241c5b828104d754a77 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 28 Jan 2013 16:01:27 -0800 Subject: [PATCH] Fix bug #9585 - Samba 3.6.x not correctly signing any but the last response in a compound request/response Add in the missing code we already have in master and 4.0.x. Signed-off-by: Jeremy Allison --- source3/smbd/smb2_server.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index 363ddef..4764b83 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -1807,6 +1807,25 @@ static NTSTATUS smbd_smb2_request_reply(struct smbd_smb2_request *req) if (!im) { return NT_STATUS_NO_MEMORY; } + + if (req->do_signing) { + /* + * We sign each reply as we go along. + * We can do this as smb2_calculate_credits() + * grants zero credits on every part of a + * compound reply except the last one, + * which is signed just before calling + * tstream_writev_queue_send(). + */ + NTSTATUS status; + status = smb2_signing_sign_pdu(req->session->session_key, + &req->out.vector[i], 3); + if (!NT_STATUS_IS_OK(status)) { + TALLOC_FREE(im); + return status; + } + } + tevent_schedule_immediate(im, req->sconn->smb2.event_ctx, smbd_smb2_request_dispatch_immediate, -- 1.8.1