Blame SOURCES/0011-IPA-add-certmap-support.patch

ecf709
From d51754859a83e7fedf0cac90ad8bf5de09f35463 Mon Sep 17 00:00:00 2001
ecf709
From: Sumit Bose <sbose@redhat.com>
ecf709
Date: Mon, 6 Feb 2017 10:28:46 +0100
ecf709
Subject: [PATCH 11/15] IPA: add certmap support
ecf709
MIME-Version: 1.0
ecf709
Content-Type: text/plain; charset=UTF-8
ecf709
Content-Transfer-Encoding: 8bit
ecf709
ecf709
Read certificate mapping data from the IPA server and configure the
ecf709
certificate mapping library accordingly.
ecf709
ecf709
Related to https://pagure.io/SSSD/sssd/issue/3050
ecf709
ecf709
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
ecf709
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
ecf709
---
ecf709
 src/providers/ipa/ipa_config.h            |   2 +
ecf709
 src/providers/ipa/ipa_subdomains.c        | 354 ++++++++++++++++++++++++++++++
ecf709
 src/providers/ipa/ipa_subdomains_server.c |   4 +
ecf709
 src/providers/ldap/ldap_id.c              |   4 +-
ecf709
 src/providers/ldap/sdap.h                 |   4 +
ecf709
 5 files changed, 367 insertions(+), 1 deletion(-)
ecf709
ecf709
diff --git a/src/providers/ipa/ipa_config.h b/src/providers/ipa/ipa_config.h
ecf709
index 2f1e147d7edab0aca2a16269c6a73bc607b21bd5..60f2d5d7b71227a1d86889ceaf6f0f9ac868480d 100644
ecf709
--- a/src/providers/ipa/ipa_config.h
ecf709
+++ b/src/providers/ipa/ipa_config.h
ecf709
@@ -37,6 +37,8 @@
ecf709
 #define IPA_CONFIG_SEARCH_BASE_TEMPLATE "cn=etc,%s"
ecf709
 #define IPA_CONFIG_FILTER "(&(cn=ipaConfig)(objectClass=ipaGuiConfig))"
ecf709
 
ecf709
+#define IPA_OC_CONFIG "ipaConfig"
ecf709
+
ecf709
 struct tevent_req * ipa_get_config_send(TALLOC_CTX *mem_ctx,
ecf709
                                         struct tevent_context *ev,
ecf709
                                         struct sdap_handle *sh,
ecf709
diff --git a/src/providers/ipa/ipa_subdomains.c b/src/providers/ipa/ipa_subdomains.c
ecf709
index b2e96b204213a52014edcc6042ffa1ff8152b8bf..7537550606ef09c0b87a80932c75aa4f93c0efab 100644
ecf709
--- a/src/providers/ipa/ipa_subdomains.c
ecf709
+++ b/src/providers/ipa/ipa_subdomains.c
ecf709
@@ -56,6 +56,24 @@
ecf709
 
ecf709
 #define IPA_SUBDOMAIN_DISABLED_PERIOD 3600
ecf709
 
ecf709
+#define IPA_OC_CERTMAP_CONFIG_OBJECT "ipaCertMapConfigObject"
ecf709
+#define IPA_CERTMAP_PROMPT_USERNAME "ipaCertMapPromptUserName"
ecf709
+
ecf709
+#define IPA_OC_CERTMAP_RULE "ipaCertMapRule"
ecf709
+#define IPA_CERTMAP_MAPRULE "ipaCertMapMapRule"
ecf709
+#define IPA_CERTMAP_MATCHRULE "ipaCertMapMatchRule"
ecf709
+#define IPA_CERTMAP_PRIORITY "ipaCertMapPriority"
ecf709
+#define IPA_ENABLED_FLAG "ipaEnabledFlag"
ecf709
+#define IPA_TRUE_VALUE "TRUE"
ecf709
+#define IPA_ASSOCIATED_DOMAIN "associatedDomain"
ecf709
+
ecf709
+#define OBJECTCLASS "objectClass"
ecf709
+
ecf709
+#define CERTMAP_FILTER "(|(&("OBJECTCLASS"="IPA_OC_CERTMAP_RULE")" \
ecf709
+                              "("IPA_ENABLED_FLAG"="IPA_TRUE_VALUE"))" \
ecf709
+                          "("OBJECTCLASS"="IPA_OC_CERTMAP_CONFIG_OBJECT"))"
ecf709
+
ecf709
+
ecf709
 struct ipa_subdomains_ctx {
ecf709
     struct be_ctx *be_ctx;
ecf709
     struct ipa_id_ctx *ipa_id_ctx;
ecf709
@@ -286,6 +304,193 @@ done:
ecf709
     return ret;
ecf709
 }
ecf709
 
ecf709
+struct priv_sss_debug {
ecf709
+    int level;
ecf709
+};
ecf709
+
ecf709
+void ext_debug(void *private, const char *file, long line, const char *function,
ecf709
+               const char *format, ...)
ecf709
+{
ecf709
+    va_list ap;
ecf709
+    struct priv_sss_debug *data = private;
ecf709
+    int level = SSSDBG_OP_FAILURE;
ecf709
+
ecf709
+    if (data != NULL) {
ecf709
+        level = data->level;
ecf709
+    }
ecf709
+
ecf709
+    if (DEBUG_IS_SET(level)) {
ecf709
+        va_start(ap, format);
ecf709
+        sss_vdebug_fn(file, line, function, level, APPEND_LINE_FEED,
ecf709
+                      format, ap);
ecf709
+        va_end(ap);
ecf709
+    }
ecf709
+}
ecf709
+
ecf709
+static errno_t ipa_certmap_parse_results(TALLOC_CTX *mem_ctx,
ecf709
+                                         struct sss_domain_info *domain,
ecf709
+                                         struct sdap_options *sdap_opts,
ecf709
+                                         size_t count,
ecf709
+                                         struct sysdb_attrs **reply,
ecf709
+                                         struct certmap_info ***_certmap_list)
ecf709
+{
ecf709
+    struct certmap_info **certmap_list = NULL;
ecf709
+    struct certmap_info *m;
ecf709
+    const char *value;
ecf709
+    const char **values;
ecf709
+    size_t c;
ecf709
+    size_t lc = 0;
ecf709
+    int ret;
ecf709
+    struct sss_certmap_ctx *certmap_ctx = NULL;
ecf709
+    const char **ocs = NULL;
ecf709
+    bool user_name_hint = false;
ecf709
+
ecf709
+    certmap_list = talloc_zero_array(mem_ctx, struct certmap_info *, count + 1);
ecf709
+    if (certmap_list == NULL) {
ecf709
+        DEBUG(SSSDBG_OP_FAILURE, "talloc_array failed.\n");
ecf709
+        return ENOMEM;
ecf709
+    }
ecf709
+
ecf709
+    for (c = 0; c < count; c++) {
ecf709
+        ret = sysdb_attrs_get_string_array(reply[c], SYSDB_OBJECTCLASS, mem_ctx,
ecf709
+                                           &ocs;;
ecf709
+        if (ret != EOK) {
ecf709
+            DEBUG(SSSDBG_OP_FAILURE,
ecf709
+                  "Missing objectclasses for config objects.\n");
ecf709
+            ret = EINVAL;
ecf709
+            goto done;
ecf709
+        }
ecf709
+
ecf709
+        if (string_in_list(IPA_OC_CERTMAP_CONFIG_OBJECT, discard_const(ocs),
ecf709
+                           false)) {
ecf709
+            ret = sysdb_attrs_get_bool(reply[c], IPA_CERTMAP_PROMPT_USERNAME,
ecf709
+                                       &user_name_hint);
ecf709
+            if (ret != EOK) {
ecf709
+                DEBUG(SSSDBG_CRIT_FAILURE,
ecf709
+                      "Failed to read user name hint option, skipping.\n");
ecf709
+            }
ecf709
+            continue;
ecf709
+        }
ecf709
+
ecf709
+        m = talloc_zero(certmap_list, struct certmap_info);
ecf709
+        if (m == NULL) {
ecf709
+            DEBUG(SSSDBG_OP_FAILURE, "talloc_zero failed.\n");
ecf709
+            ret = ENOMEM;
ecf709
+            goto done;
ecf709
+        }
ecf709
+
ecf709
+        ret = sysdb_attrs_get_string(reply[c], IPA_CN, &value);
ecf709
+        if (ret != EOK) {
ecf709
+            DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n");
ecf709
+            goto done;
ecf709
+        }
ecf709
+
ecf709
+        m->name = talloc_strdup(m, value);
ecf709
+        if (m->name == NULL) {
ecf709
+            DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n");
ecf709
+            ret = ENOMEM;
ecf709
+            goto done;
ecf709
+        }
ecf709
+
ecf709
+        ret = sysdb_attrs_get_string(reply[c], IPA_CERTMAP_MATCHRULE, &value);
ecf709
+        if (ret == EOK) {
ecf709
+            m->match_rule = talloc_strdup(m, value);
ecf709
+            if (m->match_rule == NULL) {
ecf709
+                DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n");
ecf709
+                ret = ENOMEM;
ecf709
+                goto done;
ecf709
+            }
ecf709
+        } else if (ret != ENOENT) {
ecf709
+            DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n");
ecf709
+            goto done;
ecf709
+        }
ecf709
+
ecf709
+        ret = sysdb_attrs_get_string(reply[c], IPA_CERTMAP_MAPRULE, &value);
ecf709
+        if (ret == EOK) {
ecf709
+            m->map_rule = talloc_strdup(m, value);
ecf709
+            if (m->map_rule == NULL) {
ecf709
+                DEBUG(SSSDBG_OP_FAILURE, "talloc_strdup failed.\n");
ecf709
+                ret = ENOMEM;
ecf709
+                goto done;
ecf709
+            }
ecf709
+        } else if (ret != ENOENT) {
ecf709
+            DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n");
ecf709
+            goto done;
ecf709
+        }
ecf709
+
ecf709
+        ret = sysdb_attrs_get_string_array(reply[c], IPA_ASSOCIATED_DOMAIN, m,
ecf709
+                                           &values);
ecf709
+        if (ret == EOK) {
ecf709
+            m->domains = values;
ecf709
+        } else if (ret != ENOENT) {
ecf709
+            DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n");
ecf709
+            goto done;
ecf709
+        }
ecf709
+
ecf709
+        ret = sysdb_attrs_get_uint32_t(reply[c], IPA_CERTMAP_PRIORITY,
ecf709
+                                       &m->priority);
ecf709
+        if (ret != EOK && ret != ENOENT) {
ecf709
+            DEBUG(SSSDBG_OP_FAILURE, "sysdb_attrs_get_string failed.\n");
ecf709
+            goto done;
ecf709
+        } else if (ret == ENOENT) {
ecf709
+            m->priority = SSS_CERTMAP_MIN_PRIO;
ecf709
+        }
ecf709
+
ecf709
+        certmap_list[lc++] = m;
ecf709
+    }
ecf709
+
ecf709
+    certmap_list[lc] = NULL;
ecf709
+
ecf709
+    ret = sss_certmap_init(mem_ctx, ext_debug, NULL, &certmap_ctx);
ecf709
+    if (ret != 0) {
ecf709
+        DEBUG(SSSDBG_OP_FAILURE, "sss_certmap_init failed.\n");
ecf709
+        goto done;
ecf709
+    }
ecf709
+
ecf709
+    for (c = 0; certmap_list[c] != NULL; c++) {
ecf709
+        DEBUG(SSSDBG_TRACE_ALL, "Trying to add rule [%s][%d][%s][%s].\n",
ecf709
+                                certmap_list[c]->name,
ecf709
+                                certmap_list[c]->priority,
ecf709
+                                certmap_list[c]->match_rule,
ecf709
+                                certmap_list[c]->map_rule);
ecf709
+
ecf709
+        ret = sss_certmap_add_rule(certmap_ctx, certmap_list[c]->priority,
ecf709
+                                   certmap_list[c]->match_rule,
ecf709
+                                   certmap_list[c]->map_rule,
ecf709
+                                   certmap_list[c]->domains);
ecf709
+        if (ret != 0) {
ecf709
+            DEBUG(SSSDBG_CRIT_FAILURE,
ecf709
+                  "sss_certmap_add_rule failed for rule [%s], skipping. "
ecf709
+                  "Please check for typos and if rule syntax is supported.\n",
ecf709
+                  certmap_list[c]->name);
ecf709
+            goto done;
ecf709
+        }
ecf709
+    }
ecf709
+
ecf709
+    ret = sysdb_update_certmap(domain->sysdb, certmap_list, user_name_hint);
ecf709
+    if (ret != EOK) {
ecf709
+        DEBUG(SSSDBG_OP_FAILURE, "sysdb_update_certmap failed");
ecf709
+        goto done;
ecf709
+    }
ecf709
+
ecf709
+    sss_certmap_free_ctx(sdap_opts->certmap_ctx);
ecf709
+    sdap_opts->certmap_ctx = talloc_steal(sdap_opts, certmap_ctx);
ecf709
+
ecf709
+    if (_certmap_list != NULL) {
ecf709
+        *_certmap_list = certmap_list;
ecf709
+    }
ecf709
+    ret = EOK;
ecf709
+
ecf709
+done:
ecf709
+    talloc_free(ocs);
ecf709
+    if (ret != EOK) {
ecf709
+        sss_certmap_free_ctx(certmap_ctx);
ecf709
+        talloc_free(certmap_list);
ecf709
+    }
ecf709
+
ecf709
+    return ret;
ecf709
+}
ecf709
+
ecf709
 static errno_t ipa_subdom_enumerates(struct sss_domain_info *parent,
ecf709
                                      struct sysdb_attrs *attrs,
ecf709
                                      bool *_enumerates)
ecf709
@@ -801,6 +1006,125 @@ static errno_t ipa_subdomains_ranges_recv(struct tevent_req *req)
ecf709
     return EOK;
ecf709
 }
ecf709
 
ecf709
+#define IPA_CERTMAP_SEARCH_BASE_TEMPLATE "cn=certmap,%s"
ecf709
+
ecf709
+struct ipa_subdomains_certmap_state {
ecf709
+    struct sss_domain_info *domain;
ecf709
+    struct sdap_options *sdap_opts;
ecf709
+};
ecf709
+
ecf709
+static void ipa_subdomains_certmap_done(struct tevent_req *subreq);
ecf709
+
ecf709
+static struct tevent_req *
ecf709
+ipa_subdomains_certmap_send(TALLOC_CTX *mem_ctx,
ecf709
+                           struct tevent_context *ev,
ecf709
+                           struct ipa_subdomains_ctx *sd_ctx,
ecf709
+                           struct sdap_handle *sh)
ecf709
+{
ecf709
+    struct ipa_subdomains_certmap_state *state;
ecf709
+    struct tevent_req *subreq;
ecf709
+    struct tevent_req *req;
ecf709
+    errno_t ret;
ecf709
+    char *ldap_basedn;
ecf709
+    char *search_base;
ecf709
+    const char *attrs[] = { OBJECTCLASS, IPA_CN,
ecf709
+                            IPA_CERTMAP_MAPRULE, IPA_CERTMAP_MATCHRULE,
ecf709
+                            IPA_CERTMAP_PRIORITY, IPA_ASSOCIATED_DOMAIN,
ecf709
+                            IPA_CERTMAP_PROMPT_USERNAME,
ecf709
+                            NULL };
ecf709
+
ecf709
+    req = tevent_req_create(mem_ctx, &state,
ecf709
+                            struct ipa_subdomains_certmap_state);
ecf709
+    if (req == NULL) {
ecf709
+        DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n");
ecf709
+        return NULL;
ecf709
+    }
ecf709
+
ecf709
+    state->domain = sd_ctx->be_ctx->domain;
ecf709
+    state->sdap_opts = sd_ctx->sdap_id_ctx->opts;
ecf709
+
ecf709
+    ret = domain_to_basedn(state, state->domain->name, &ldap_basedn);
ecf709
+    if (ret != EOK) {
ecf709
+        DEBUG(SSSDBG_OP_FAILURE, "domain_to_basedn failed.\n");
ecf709
+        goto immediately;
ecf709
+    }
ecf709
+
ecf709
+    search_base = talloc_asprintf(state, IPA_CERTMAP_SEARCH_BASE_TEMPLATE,
ecf709
+                                  ldap_basedn);
ecf709
+    if (search_base == NULL) {
ecf709
+        DEBUG(SSSDBG_OP_FAILURE, "talloc_asprintf failed.\n");
ecf709
+        ret = ENOMEM;
ecf709
+        goto immediately;
ecf709
+    }
ecf709
+
ecf709
+    subreq = sdap_get_generic_send(state, ev, sd_ctx->sdap_id_ctx->opts, sh,
ecf709
+                                   search_base, LDAP_SCOPE_SUBTREE,
ecf709
+                                   CERTMAP_FILTER,
ecf709
+                                   attrs, NULL, 0, 0, false);
ecf709
+    if (subreq == NULL) {
ecf709
+        ret = ENOMEM;
ecf709
+        goto immediately;
ecf709
+    }
ecf709
+
ecf709
+    tevent_req_set_callback(subreq, ipa_subdomains_certmap_done, req);
ecf709
+
ecf709
+    return req;
ecf709
+
ecf709
+immediately:
ecf709
+    if (ret == EOK) {
ecf709
+        tevent_req_done(req);
ecf709
+    } else {
ecf709
+        tevent_req_error(req, ret);
ecf709
+    }
ecf709
+    tevent_req_post(req, ev);
ecf709
+
ecf709
+    return req;
ecf709
+}
ecf709
+
ecf709
+static void ipa_subdomains_certmap_done(struct tevent_req *subreq)
ecf709
+{
ecf709
+    struct ipa_subdomains_certmap_state *state;
ecf709
+    struct tevent_req *req;
ecf709
+    struct sysdb_attrs **reply;
ecf709
+    size_t reply_count;
ecf709
+    errno_t ret;
ecf709
+
ecf709
+    req = tevent_req_callback_data(subreq, struct tevent_req);
ecf709
+    state = tevent_req_data(req, struct ipa_subdomains_certmap_state);
ecf709
+
ecf709
+    ret = sdap_get_generic_recv(subreq, state, &reply_count, &reply);
ecf709
+    talloc_zfree(subreq);
ecf709
+    if (ret != EOK) {
ecf709
+        DEBUG(SSSDBG_CRIT_FAILURE, "Unable to get data from LDAP [%d]: %s\n",
ecf709
+                      ret, sss_strerror(ret));
ecf709
+        goto done;
ecf709
+    }
ecf709
+
ecf709
+    ret = ipa_certmap_parse_results(state, state->domain,
ecf709
+                                    state->sdap_opts,
ecf709
+                                    reply_count, reply, NULL);
ecf709
+    if (ret != EOK) {
ecf709
+        DEBUG(SSSDBG_OP_FAILURE, "Unable to parse certmap results [%d]: %s\n",
ecf709
+              ret, sss_strerror(ret));
ecf709
+        goto done;
ecf709
+    }
ecf709
+
ecf709
+done:
ecf709
+    if (ret != EOK) {
ecf709
+        tevent_req_error(req, ret);
ecf709
+        return;
ecf709
+    }
ecf709
+
ecf709
+    tevent_req_done(req);
ecf709
+}
ecf709
+
ecf709
+static errno_t ipa_subdomains_certmap_recv(struct tevent_req *req)
ecf709
+{
ecf709
+    TEVENT_REQ_RETURN_ON_ERROR(req);
ecf709
+
ecf709
+    return EOK;
ecf709
+}
ecf709
+
ecf709
 struct ipa_subdomains_master_state {
ecf709
     struct sss_domain_info *domain;
ecf709
     struct ipa_options *ipa_options;
ecf709
@@ -1365,6 +1689,7 @@ struct ipa_subdomains_refresh_state {
ecf709
 static errno_t ipa_subdomains_refresh_retry(struct tevent_req *req);
ecf709
 static void ipa_subdomains_refresh_connect_done(struct tevent_req *subreq);
ecf709
 static void ipa_subdomains_refresh_ranges_done(struct tevent_req *subreq);
ecf709
+static void ipa_subdomains_refresh_certmap_done(struct tevent_req *subreq);
ecf709
 static void ipa_subdomains_refresh_master_done(struct tevent_req *subreq);
ecf709
 static void ipa_subdomains_refresh_slave_done(struct tevent_req *subreq);
ecf709
 static void ipa_subdomains_refresh_view_done(struct tevent_req *subreq);
ecf709
@@ -1487,6 +1812,35 @@ static void ipa_subdomains_refresh_ranges_done(struct tevent_req *subreq)
ecf709
         return;
ecf709
     }
ecf709
 
ecf709
+    subreq = ipa_subdomains_certmap_send(state, state->ev, state->sd_ctx,
ecf709
+                                         sdap_id_op_handle(state->sdap_op));
ecf709
+    if (subreq == NULL) {
ecf709
+        tevent_req_error(req, ENOMEM);
ecf709
+        return;
ecf709
+    }
ecf709
+
ecf709
+    tevent_req_set_callback(subreq, ipa_subdomains_refresh_certmap_done, req);
ecf709
+    return;
ecf709
+}
ecf709
+
ecf709
+static void ipa_subdomains_refresh_certmap_done(struct tevent_req *subreq)
ecf709
+{
ecf709
+    struct ipa_subdomains_refresh_state *state;
ecf709
+    struct tevent_req *req;
ecf709
+    errno_t ret;
ecf709
+
ecf709
+    req = tevent_req_callback_data(subreq, struct tevent_req);
ecf709
+    state = tevent_req_data(req, struct ipa_subdomains_refresh_state);
ecf709
+
ecf709
+    ret = ipa_subdomains_certmap_recv(subreq);
ecf709
+    talloc_zfree(subreq);
ecf709
+    if (ret != EOK) {
ecf709
+        DEBUG(SSSDBG_CRIT_FAILURE, "Failed to read certificate mapping rules "
ecf709
+              "[%d]: %s\n", ret, sss_strerror(ret));
ecf709
+        tevent_req_error(req, ret);
ecf709
+        return;
ecf709
+    }
ecf709
+
ecf709
     subreq = ipa_subdomains_master_send(state, state->ev, state->sd_ctx,
ecf709
                                         sdap_id_op_handle(state->sdap_op));
ecf709
     if (subreq == NULL) {
ecf709
diff --git a/src/providers/ipa/ipa_subdomains_server.c b/src/providers/ipa/ipa_subdomains_server.c
ecf709
index 1af8676c5a9c49121d0f0118a46796c6637f04f9..ae3baf036e4278fb67d86b42742fb7e80b46724e 100644
ecf709
--- a/src/providers/ipa/ipa_subdomains_server.c
ecf709
+++ b/src/providers/ipa/ipa_subdomains_server.c
ecf709
@@ -362,6 +362,10 @@ ipa_ad_ctx_new(struct be_ctx *be_ctx,
ecf709
     ad_id_ctx->sdap_id_ctx->opts->idmap_ctx =
ecf709
         id_ctx->sdap_id_ctx->opts->idmap_ctx;
ecf709
 
ecf709
+    /* Set up the certificate mapping context */
ecf709
+    ad_id_ctx->sdap_id_ctx->opts->certmap_ctx =
ecf709
+        id_ctx->sdap_id_ctx->opts->certmap_ctx;
ecf709
+
ecf709
     *_ad_id_ctx = ad_id_ctx;
ecf709
     return EOK;
ecf709
 }
ecf709
diff --git a/src/providers/ldap/ldap_id.c b/src/providers/ldap/ldap_id.c
ecf709
index 8e60769d09383ac8ebe33e5f64fd4fd9788e82cd..0bee0ca8d71abece6749fdb8393b9ceacb64417d 100644
ecf709
--- a/src/providers/ldap/ldap_id.c
ecf709
+++ b/src/providers/ldap/ldap_id.c
ecf709
@@ -247,7 +247,9 @@ struct tevent_req *users_get_send(TALLOC_CTX *memctx,
ecf709
         }
ecf709
 
ecf709
         ret = sss_cert_derb64_to_ldap_filter(state, filter_value, attr_name,
ecf709
-                                             NULL, NULL, &user_filter);
ecf709
+                                             ctx->opts->certmap_ctx,
ecf709
+                                             state->domain,
ecf709
+                                             &user_filter);
ecf709
         if (ret != EOK) {
ecf709
             DEBUG(SSSDBG_OP_FAILURE,
ecf709
                   "sss_cert_derb64_to_ldap_filter failed.\n");
ecf709
diff --git a/src/providers/ldap/sdap.h b/src/providers/ldap/sdap.h
ecf709
index 6079a8bf62d0bdf23c8d462dc0f19c705e391a6e..afdc01948eefe9dda943c8c7ad01a42dd76a1da8 100644
ecf709
--- a/src/providers/ldap/sdap.h
ecf709
+++ b/src/providers/ldap/sdap.h
ecf709
@@ -25,6 +25,7 @@
ecf709
 #include "providers/backend.h"
ecf709
 #include <ldap.h>
ecf709
 #include "util/sss_ldap.h"
ecf709
+#include "lib/certmap/sss_certmap.h"
ecf709
 
ecf709
 struct sdap_msg {
ecf709
     struct sdap_msg *next;
ecf709
@@ -478,6 +479,9 @@ struct sdap_options {
ecf709
 
ecf709
     bool support_matching_rule;
ecf709
     enum dc_functional_level dc_functional_level;
ecf709
+
ecf709
+    /* Certificate mapping support */
ecf709
+    struct sss_certmap_ctx *certmap_ctx;
ecf709
 };
ecf709
 
ecf709
 struct sdap_server_opts {
ecf709
-- 
ecf709
2.9.3
ecf709