diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-09-03 10:18:17 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-11-24 19:02:31 +0100 |
commit | 99b3d57fc36ca7e0f493b79886027930278b812a (patch) | |
tree | 44615e09982fb566c066dbca80edc9612d3d03b3 /libcli | |
parent | 396d7a7dd3d1583109b477ea5b223670903cde0d (diff) | |
download | samba-99b3d57fc36ca7e0f493b79886027930278b812a.tar.gz samba-99b3d57fc36ca7e0f493b79886027930278b812a.tar.bz2 samba-99b3d57fc36ca7e0f493b79886027930278b812a.zip |
s3:smb2cli: make use of smbXcli_session and setup the session key for SMB2 signing
metze
Diffstat (limited to 'libcli')
-rw-r--r-- | libcli/smb/smbXcli_base.c | 14 | ||||
-rw-r--r-- | libcli/smb/smbXcli_base.h | 4 |
2 files changed, 12 insertions, 6 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); } diff --git a/libcli/smb/smbXcli_base.h b/libcli/smb/smbXcli_base.h index c64e3bad2f..f345587cd2 100644 --- a/libcli/smb/smbXcli_base.h +++ b/libcli/smb/smbXcli_base.h @@ -149,7 +149,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, @@ -172,7 +172,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, |