From 5e34173041eb04e30f3f6f81a3269d621220b09c Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 14 Sep 2024 09:55:20 +0200 Subject: [PATCH] librpc/rpc: add dcerpc_binding_handle_auth_session_key() Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- librpc/rpc/binding_handle.c | 12 ++++++++++++ librpc/rpc/rpc_common.h | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/librpc/rpc/binding_handle.c b/librpc/rpc/binding_handle.c index f165b47451d..f8c7add27ea 100644 --- a/librpc/rpc/binding_handle.c +++ b/librpc/rpc/binding_handle.c @@ -144,6 +144,18 @@ void dcerpc_binding_handle_auth_info(struct dcerpc_binding_handle *h, h->ops->auth_info(h, auth_type, auth_level); } +NTSTATUS dcerpc_binding_handle_auth_session_key( + struct dcerpc_binding_handle *h, + TALLOC_CTX *mem_ctx, + DATA_BLOB *session_key) +{ + if (h->ops->auth_session_key == NULL) { + return NT_STATUS_NO_USER_SESSION_KEY; + } + + return h->ops->auth_session_key(h, mem_ctx, session_key); +} + struct dcerpc_binding_handle_raw_call_state { const struct dcerpc_binding_handle_ops *ops; uint8_t *out_data; diff --git a/librpc/rpc/rpc_common.h b/librpc/rpc/rpc_common.h index 7faeb5f00b3..565c68c2ecf 100644 --- a/librpc/rpc/rpc_common.h +++ b/librpc/rpc/rpc_common.h @@ -184,6 +184,9 @@ struct dcerpc_binding_handle_ops { void (*auth_info)(struct dcerpc_binding_handle *h, enum dcerpc_AuthType *auth_type, enum dcerpc_AuthLevel *auth_level); + NTSTATUS (*auth_session_key)(struct dcerpc_binding_handle *h, + TALLOC_CTX *mem_ctx, + DATA_BLOB *session_key); struct tevent_req *(*raw_call_send)(TALLOC_CTX *mem_ctx, struct tevent_context *ev, @@ -266,6 +269,11 @@ void dcerpc_binding_handle_auth_info(struct dcerpc_binding_handle *h, enum dcerpc_AuthType *auth_type, enum dcerpc_AuthLevel *auth_level); +NTSTATUS dcerpc_binding_handle_auth_session_key( + struct dcerpc_binding_handle *h, + TALLOC_CTX *mem_ctx, + DATA_BLOB *session_key); + struct tevent_req *dcerpc_binding_handle_raw_call_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct dcerpc_binding_handle *h,