1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

smb2srv: sign replies when the request was also signed

metze
(This used to be commit dd2f4f7a491debcc30e590f571272afd99e52940)
This commit is contained in:
Stefan Metzmacher 2008-08-13 15:20:18 +02:00
parent 4a214dba30
commit 0294c678c0
2 changed files with 4 additions and 7 deletions

View File

@ -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)) {

View File

@ -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;
};