diff options
author | Stefan Metzmacher <metze@samba.org> | 2014-09-25 01:22:29 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2014-09-30 23:35:08 +0200 |
commit | aa4310b0af1f7ee2acfbcef47030d743ac41ffa0 (patch) | |
tree | 57acaa7816e82820d07e8d1f99abdd4d5f753995 /libcli/smb | |
parent | e9a5074e6b75ec193d6fd8891e6ffb3f54af88f1 (diff) | |
download | samba-aa4310b0af1f7ee2acfbcef47030d743ac41ffa0.tar.gz samba-aa4310b0af1f7ee2acfbcef47030d743ac41ffa0.tar.xz samba-aa4310b0af1f7ee2acfbcef47030d743ac41ffa0.zip |
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>
Diffstat (limited to 'libcli/smb')
-rw-r--r-- | libcli/smb/smbXcli_base.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c index 6c367aeb94..113699c6b7 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) { |