summaryrefslogtreecommitdiff
path: root/source4/smb_server/request.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-05-22 11:16:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:53:52 -0500
commitc5e11daa8bb00665efabbf7939062e7e60112ced (patch)
treebe3afcd3242ae31225776f74fe97cd2b41b7be56 /source4/smb_server/request.c
parent93076cb9bc56a515bbefb6d88470d6776169779a (diff)
downloadsamba-c5e11daa8bb00665efabbf7939062e7e60112ced.tar.gz
samba-c5e11daa8bb00665efabbf7939062e7e60112ced.tar.bz2
samba-c5e11daa8bb00665efabbf7939062e7e60112ced.zip
r818: added server side SMB signing to Samba4
(This used to be commit 8e5ddf5e8eb74f667897f90baa2d00f02ca5818b)
Diffstat (limited to 'source4/smb_server/request.c')
-rw-r--r--source4/smb_server/request.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/source4/smb_server/request.c b/source4/smb_server/request.c
index 964f4a2d70..5c1d14a9d0 100644
--- a/source4/smb_server/request.c
+++ b/source4/smb_server/request.c
@@ -256,7 +256,7 @@ void req_grow_data(struct request_context *req, unsigned new_size)
note that this only looks at req->out.buffer and req->out.size, allowing manually
constructed packets to be sent
*/
-void req_send_reply(struct request_context *req)
+void req_send_reply_nosign(struct request_context *req)
{
if (req->out.size > NBT_HDR_SIZE) {
_smb_setlen(req->out.buffer, req->out.size - NBT_HDR_SIZE);
@@ -269,6 +269,23 @@ void req_send_reply(struct request_context *req)
req_destroy(req);
}
+/*
+ possibly sign a message then send a reply and destroy the request buffer
+
+ note that this only looks at req->out.buffer and req->out.size, allowing manually
+ constructed packets to be sent
+*/
+void req_send_reply(struct request_context *req)
+{
+ if (req->out.size > NBT_HDR_SIZE) {
+ _smb_setlen(req->out.buffer, req->out.size - NBT_HDR_SIZE);
+ }
+
+ req_sign_packet(req);
+
+ req_send_reply_nosign(req);
+}
+
/*