summaryrefslogtreecommitdiff
path: root/source/smb_server
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-08-13 15:20:18 +0200
committerStefan Metzmacher <metze@samba.org>2008-08-14 13:13:50 +0200
commitdd2f4f7a491debcc30e590f571272afd99e52940 (patch)
tree9b18aca093ba1d54b4850ad035f609c7da6e8ec5 /source/smb_server
parent7c4abf6614c47471ae005a12abe27d85890d867f (diff)
downloadsamba-dd2f4f7a491debcc30e590f571272afd99e52940.tar.gz
smb2srv: sign replies when the request was also signed
metze
Diffstat (limited to 'source/smb_server')
-rw-r--r--source/smb_server/smb2/receive.c9
-rw-r--r--source/smb_server/smb2/smb2_server.h2
2 files changed, 4 insertions, 7 deletions
diff --git a/source/smb_server/smb2/receive.c b/source/smb_server/smb2/receive.c
index 007125c4c49..bcc91e4ee3c 100644
--- a/source/smb_server/smb2/receive.c
+++ b/source/smb_server/smb2/receive.c
@@ -236,7 +236,7 @@ void smb2srv_send_reply(struct smb2srv_request *req)
}
/* if signing is active on the session then sign the packet */
- if (req->session && req->session->smb2_signing.active) {
+ if (req->is_signed) {
status = smb2_sign_message(&req->out,
req->session->session_info->session_key);
if (!NT_STATUS_IS_OK(status)) {
@@ -310,12 +310,7 @@ static NTSTATUS smb2srv_reply(struct smb2srv_request *req)
if (!req->session) goto nosession;
- if (!req->session->smb2_signing.active) {
- /* TODO: workout the correct error code */
- smb2srv_send_error(req, NT_STATUS_FOOBAR);
- return NT_STATUS_OK;
- }
-
+ req->is_signed = true;
status = smb2_check_signature(&req->in,
req->session->session_info->session_key);
if (!NT_STATUS_IS_OK(status)) {
diff --git a/source/smb_server/smb2/smb2_server.h b/source/smb_server/smb2/smb2_server.h
index ae4abbd71e1..d45e0861af4 100644
--- a/source/smb_server/smb2/smb2_server.h
+++ b/source/smb_server/smb2/smb2_server.h
@@ -62,6 +62,8 @@ struct smb2srv_request {
uint8_t _chained_file_handle[16];
uint8_t *chained_file_handle;
+ bool is_signed;
+
struct smb2_request_buffer in;
struct smb2_request_buffer out;
};