From 8c33036a374b6f61677965dbb357d6ae7216cbfb Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 26 Aug 2011 13:23:41 +1000 Subject: s4-subdomain more work on sub-domain join we can now create a subdomain of an existing windows domain using: samba-tool domain join sub.domain.dns.name subdomain The ordering of the creation of the key records is quite tricky, especially for the NTDSDSA object Pair-Programmed-With: Andrew Tridgell --- source4/librpc/rpc/pyrpc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source4/librpc/rpc') 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 } }; -- cgit