summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/idl/lsa.idl25
-rw-r--r--source4/librpc/rpc/dcerpc_util.c22
2 files changed, 45 insertions, 2 deletions
diff --git a/source4/librpc/idl/lsa.idl b/source4/librpc/idl/lsa.idl
index d8c6389bb3..2e3049ac78 100644
--- a/source4/librpc/idl/lsa.idl
+++ b/source4/librpc/idl/lsa.idl
@@ -411,9 +411,30 @@
);
/* Function: 0x1d */
- NTSTATUS SETSECRET ();
+ typedef [flag(NDR_PAHEX)] struct {
+ uint32 length;
+ uint32 size;
+ [size_is(size),length_is(length)] uint8 *data;
+ } lsa_DATA_BUF;
+
+ NTSTATUS lsa_SetSecret(
+ [in,ref] policy_handle *handle,
+ [in] lsa_DATA_BUF *new_val,
+ [in] lsa_DATA_BUF *old_val
+ );
+
+ typedef struct {
+ lsa_DATA_BUF *buf;
+ } lsa_DATA_BUF_PTR;
+
/* Function: 0x1e */
- NTSTATUS QUERYSECRET ();
+ NTSTATUS lsa_QuerySecret (
+ [in,ref] policy_handle *handle,
+ [in,out] lsa_DATA_BUF_PTR *new_val,
+ [in,out] NTTIME *new_mtime,
+ [in,out] lsa_DATA_BUF_PTR *old_val,
+ [in,out] NTTIME *old_mtime
+ );
/* Function: 0x1f */
NTSTATUS LOOKUPPRIVVALUE ();
diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c
index ba61f28c95..b52631670b 100644
--- a/source4/librpc/rpc/dcerpc_util.c
+++ b/source4/librpc/rpc/dcerpc_util.c
@@ -666,3 +666,25 @@ NTSTATUS dcerpc_secondary_smb(struct dcerpc_pipe *p, struct dcerpc_pipe **p2,
return NT_STATUS_OK;
}
+
+
+/*
+ fetch the user session key for the underlying transport. Currently
+ only works for the ncacn_np transport
+*/
+NTSTATUS dcerpc_fetch_session_key(struct dcerpc_pipe *p,
+ uint8 session_key[16])
+{
+ struct cli_tree *tree;
+
+ tree = dcerpc_smb_tree(p);
+ if (!tree) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
+ memcpy(session_key,
+ tree->session->transport->negotiate.user_session_key,
+ 16);
+
+ return NT_STATUS_OK;
+}