summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc/dcerpc_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/librpc/rpc/dcerpc_util.c')
-rw-r--r--source4/librpc/rpc/dcerpc_util.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c
index b52631670b..0e045e0033 100644
--- a/source4/librpc/rpc/dcerpc_util.c
+++ b/source4/librpc/rpc/dcerpc_util.c
@@ -677,14 +677,23 @@ NTSTATUS dcerpc_fetch_session_key(struct dcerpc_pipe *p,
{
struct cli_tree *tree;
+ memset(session_key, 0, 16);
+
tree = dcerpc_smb_tree(p);
- if (!tree) {
- return NT_STATUS_INVALID_PARAMETER;
+ if (tree) {
+ memcpy(session_key,
+ tree->session->transport->negotiate.user_session_key,
+ 16);
}
- memcpy(session_key,
- tree->session->transport->negotiate.user_session_key,
- 16);
+ if (p->security_state) {
+ NTSTATUS status;
+
+ status = p->security_state->session_key(p->security_state, session_key);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+ }
return NT_STATUS_OK;
}