summaryrefslogtreecommitdiff
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
commit0294c678c0665e675673ff477df26fddd8ed53dd (patch)
tree907cb64212c30bc59f280ae52c96520600dc5bc9
parent4a214dba301474c48f2ae45194b0e363440ee01d (diff)
downloadsamba-0294c678c0665e675673ff477df26fddd8ed53dd.tar.gz
samba-0294c678c0665e675673ff477df26fddd8ed53dd.tar.bz2
samba-0294c678c0665e675673ff477df26fddd8ed53dd.zip
smb2srv: sign replies when the request was also signed
metze (This used to be commit dd2f4f7a491debcc30e590f571272afd99e52940)
-rw-r--r--source4/smb_server/smb2/receive.c9
-rw-r--r--source4/smb_server/smb2/smb2_server.h2
2 files changed, 4 insertions, 7 deletions
diff --git a/source4/smb_server/smb2/receive.c b/source4/smb_server/smb2/receive.c
index 007125c4c4..bcc91e4ee3 100644
--- a/source4/smb_server/smb2/receive.c
+++ b/source4/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/source4/smb_server/smb2/smb2_server.h b/source4/smb_server/smb2/smb2_server.h
index ae4abbd71e..d45e0861af 100644
--- a/source4/smb_server/smb2/smb2_server.h
+++ b/source4/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;
};