summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/rpc/pyrpc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source4/librpc/rpc/pyrpc.c b/source4/librpc/rpc/pyrpc.c
index 2d6e1f6c61..7aa5ff5868 100644
--- a/source4/librpc/rpc/pyrpc.c
+++ b/source4/librpc/rpc/pyrpc.c
@@ -117,6 +117,17 @@ static PyObject *py_iface_transfer_syntax(PyObject *obj, void *closure)
return py_ndr_syntax_id(&iface->pipe->transfer_syntax);
}
+static PyObject *py_iface_session_key(PyObject *obj, void *closure)
+{
+ dcerpc_InterfaceObject *iface = (dcerpc_InterfaceObject *)obj;
+ DATA_BLOB session_key;
+
+ NTSTATUS status = dcerpc_fetch_session_key(iface->pipe, &session_key);
+ PyErr_NTSTATUS_IS_ERR_RAISE(status);
+
+ return PyString_FromStringAndSize((const char *)session_key.data, session_key.length);
+}
+
static PyGetSetDef dcerpc_interface_getsetters[] = {
{ discard_const_p(char, "server_name"), py_iface_server_name, NULL,
discard_const_p(char, "name of the server, if connected over SMB") },
@@ -124,6 +135,8 @@ static PyGetSetDef dcerpc_interface_getsetters[] = {
discard_const_p(char, "syntax id of the abstract syntax") },
{ discard_const_p(char, "transfer_syntax"), py_iface_transfer_syntax, NULL,
discard_const_p(char, "syntax id of the transfersyntax") },
+ { discard_const_p(char, "session_key"), py_iface_session_key, NULL,
+ discard_const_p(char, "session key (as used for blob encryption on LSA and SAMR)") },
{ NULL }
};