libpts: Move settings to <ns>.plugins with fallback to libimcv
[strongswan.git] / src / libpts / plugins / imc_swid / imc_swid.c
index ed6dd8b..d4aaeff 100644 (file)
@@ -154,7 +154,8 @@ static TNC_Result receive_message(imc_state_t *state, imc_msg_t *in_msg)
                tcg_swid_attr_req_t *attr_req;
                u_int8_t flags;
                u_int32_t request_id, eid_epoch;
-               swid_inventory_t *swid_inventory;
+               swid_inventory_t *swid_inventory, *targets;
+               char *swid_directory;
                bool full_tags;
 
                type = attr->get_type(attr);
@@ -167,6 +168,7 @@ static TNC_Result receive_message(imc_state_t *state, imc_msg_t *in_msg)
                attr_req = (tcg_swid_attr_req_t*)attr;
                flags = attr_req->get_flags(attr_req);
                request_id = attr_req->get_request_id(attr_req);
+               targets = attr_req->get_targets(attr_req);
                eid_epoch = swid_state->get_eid_epoch(swid_state);
 
                if (flags & (TCG_SWID_ATTR_REQ_FLAG_S | TCG_SWID_ATTR_REQ_FLAG_C))
@@ -178,8 +180,11 @@ static TNC_Result receive_message(imc_state_t *state, imc_msg_t *in_msg)
                }
                full_tags = (flags & TCG_SWID_ATTR_REQ_FLAG_R) == 0;
 
+               swid_directory = lib->settings->get_str(lib->settings,
+                                                               "%s.plugins.imc-swid.swid_directory",
+                                                                SWID_DIRECTORY, lib->ns);
                swid_inventory = swid_inventory_create(full_tags);
-               if (!swid_inventory->collect(swid_inventory))
+               if (!swid_inventory->collect(swid_inventory, swid_directory, targets))
                {
                        swid_inventory->destroy(swid_inventory);
                        attr = swid_error_create(TCG_SWID_ERROR, request_id,