summaryrefslogtreecommitdiffstats
path: root/libcli/smb/smbXcli_base.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-03 10:18:17 +0200
committerStefan Metzmacher <metze@samba.org>2011-11-24 19:02:31 +0100
commit99b3d57fc36ca7e0f493b79886027930278b812a (patch)
tree44615e09982fb566c066dbca80edc9612d3d03b3 /libcli/smb/smbXcli_base.c
parent396d7a7dd3d1583109b477ea5b223670903cde0d (diff)
downloadsamba-99b3d57fc36ca7e0f493b79886027930278b812a.tar.gz
samba-99b3d57fc36ca7e0f493b79886027930278b812a.tar.xz
samba-99b3d57fc36ca7e0f493b79886027930278b812a.zip
s3:smb2cli: make use of smbXcli_session and setup the session key for SMB2 signing
metze
Diffstat (limited to 'libcli/smb/smbXcli_base.c')
-rw-r--r--libcli/smb/smbXcli_base.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index e2ff017465..05bbe38137 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -2008,7 +2008,7 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
uint32_t timeout_msec,
uint32_t pid,
uint32_t tid,
- uint64_t uid,
+ struct smbXcli_session *session,
const uint8_t *fixed,
uint16_t fixed_len,
const uint8_t *dyn,
@@ -2017,6 +2017,7 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
struct tevent_req *req;
struct smbXcli_req_state *state;
uint32_t flags = 0;
+ uint64_t uid = 0;
req = tevent_req_create(mem_ctx, &state,
struct smbXcli_req_state);
@@ -2026,6 +2027,11 @@ struct tevent_req *smb2cli_req_create(TALLOC_CTX *mem_ctx,
state->ev = ev;
state->conn = conn;
+ state->session = session;
+
+ if (session) {
+ uid = session->smb2.session_id;
+ }
state->smb2.recv_iov = talloc_zero_array(state, struct iovec, 3);
if (state->smb2.recv_iov == NULL) {
@@ -2247,7 +2253,7 @@ struct tevent_req *smb2cli_req_send(TALLOC_CTX *mem_ctx,
uint32_t timeout_msec,
uint32_t pid,
uint32_t tid,
- uint64_t uid,
+ struct smbXcli_session *session,
const uint8_t *fixed,
uint16_t fixed_len,
const uint8_t *dyn,
@@ -2259,7 +2265,7 @@ struct tevent_req *smb2cli_req_send(TALLOC_CTX *mem_ctx,
req = smb2cli_req_create(mem_ctx, ev, conn, cmd,
additional_flags, clear_flags,
timeout_msec,
- pid, tid, uid,
+ pid, tid, session,
fixed, fixed_len, dyn, dyn_len);
if (req == NULL) {
return NULL;
@@ -3347,7 +3353,7 @@ static struct tevent_req *smbXcli_negprot_smb2_subreq(struct smbXcli_negprot_sta
state->conn, SMB2_OP_NEGPROT,
0, 0, /* flags */
state->timeout_msec,
- 0xFEFF, 0, 0, /* pid, tid, uid */
+ 0xFEFF, 0, NULL, /* pid, tid, session */
state->smb2.fixed, sizeof(state->smb2.fixed),
state->smb2.dyn, dialect_count*2);
}