summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-09-25 01:22:29 +0200
committerMichael Adam <obnox@samba.org>2014-09-30 23:35:08 +0200
commitaa4310b0af1f7ee2acfbcef47030d743ac41ffa0 (patch)
tree57acaa7816e82820d07e8d1f99abdd4d5f753995
parente9a5074e6b75ec193d6fd8891e6ffb3f54af88f1 (diff)
downloadsamba-aa4310b0af1f7ee2acfbcef47030d743ac41ffa0.tar.gz
libcli/smb: support additional_flags = SMB2_HDR_FLAG_SIGNED
With SMB2_HDR_FLAG_SIGNED we make sure that we either use smb2 signing or smb2 encryption for the request. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r--libcli/smb/smbXcli_base.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 6c367aeb945..113699c6b71 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -2679,6 +2679,16 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
session->smb2_channel.signing_key.length == 0) {
state->smb2.should_encrypt = false;
}
+
+ if (additional_flags & SMB2_HDR_FLAG_SIGNED) {
+ if (session->smb2_channel.signing_key.length == 0) {
+ tevent_req_nterror(req, NT_STATUS_NO_USER_SESSION_KEY);
+ return req;
+ }
+
+ additional_flags &= ~SMB2_HDR_FLAG_SIGNED;
+ state->smb2.should_sign = true;
+ }
}
if (tcon) {