s4:librpc: implement dcerpc_binding_handle_auth_info()
authorStefan Metzmacher <metze@samba.org>
Mon, 12 Aug 2013 06:19:57 +0000 (08:19 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 16 Oct 2013 19:48:44 +0000 (08:48 +1300)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/librpc/rpc/dcerpc.c

index e653cbaea69ac37ff7484c805f25b404da8a128a..fd724063c2ac0756ec2af4d6c7191ddc2e8c1592 100644 (file)
@@ -200,6 +200,29 @@ static uint32_t dcerpc_bh_set_timeout(struct dcerpc_binding_handle *h,
        return old;
 }
 
+static void dcerpc_bh_auth_info(struct dcerpc_binding_handle *h,
+                               enum dcerpc_AuthType *auth_type,
+                               enum dcerpc_AuthLevel *auth_level)
+{
+       struct dcerpc_bh_state *hs = dcerpc_binding_handle_data(h,
+                                    struct dcerpc_bh_state);
+
+       if (hs->p == NULL) {
+               return;
+       }
+
+       if (hs->p->conn == NULL) {
+               return;
+       }
+
+       if (hs->p->conn->security_state.auth_info == NULL) {
+               return;
+       }
+
+       *auth_type = hs->p->conn->security_state.auth_info->auth_type;
+       *auth_level = hs->p->conn->security_state.auth_info->auth_level;
+}
+
 struct dcerpc_bh_raw_call_state {
        struct tevent_context *ev;
        struct dcerpc_binding_handle *h;
@@ -552,6 +575,7 @@ static const struct dcerpc_binding_handle_ops dcerpc_bh_ops = {
        .name                   = "dcerpc",
        .is_connected           = dcerpc_bh_is_connected,
        .set_timeout            = dcerpc_bh_set_timeout,
+       .auth_info              = dcerpc_bh_auth_info,
        .raw_call_send          = dcerpc_bh_raw_call_send,
        .raw_call_recv          = dcerpc_bh_raw_call_recv,
        .disconnect_send        = dcerpc_bh_disconnect_send,