summaryrefslogtreecommitdiff
path: root/src/libimcv/imcv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libimcv/imcv.c')
-rw-r--r--src/libimcv/imcv.c45
1 files changed, 43 insertions, 2 deletions
diff --git a/src/libimcv/imcv.c b/src/libimcv/imcv.c
index 30679a33d..bd4156c19 100644
--- a/src/libimcv/imcv.c
+++ b/src/libimcv/imcv.c
@@ -15,6 +15,14 @@
#include "imcv.h"
#include "ietf/ietf_attr.h"
#include "ita/ita_attr.h"
+#include "tcg/tcg_attr.h"
+#include "pts/components/pts_component.h"
+#include "pts/components/pts_component_manager.h"
+#include "pts/components/tcg/tcg_comp_func_name.h"
+#include "pts/components/ita/ita_comp_func_name.h"
+#include "pts/components/ita/ita_comp_ima.h"
+#include "pts/components/ita/ita_comp_tboot.h"
+#include "pts/components/ita/ita_comp_tgrub.h"
#include <utils/debug.h>
#include <utils/utils.h>
@@ -24,8 +32,12 @@
#include <syslog.h>
#endif
+#ifndef IPSEC_SCRIPT
+#define IPSEC_SCRIPT "ipsec"
+#endif
+
#define IMCV_DEBUG_LEVEL 1
-#define IMCV_DEFAULT_POLICY_SCRIPT "ipsec _imv_policy"
+#define IMCV_DEFAULT_POLICY_SCRIPT IPSEC_SCRIPT " _imv_policy"
/**
@@ -44,6 +56,11 @@ imv_session_manager_t *imcv_sessions;
imv_database_t *imcv_db;
/**
+ * PTS Functional Component manager
+ */
+pts_component_manager_t *imcv_pts_components;
+
+/**
* Reference count for libimcv
*/
static refcount_t libimcv_ref = 0;
@@ -162,7 +179,26 @@ bool libimcv_init(bool is_imv)
ietf_attr_create_from_data, ietf_attr_names);
imcv_pa_tnc_attributes->add_vendor(imcv_pa_tnc_attributes, PEN_ITA,
ita_attr_create_from_data, ita_attr_names);
-
+ imcv_pa_tnc_attributes->add_vendor(imcv_pa_tnc_attributes, PEN_TCG,
+ tcg_attr_create_from_data, tcg_attr_names);
+
+ imcv_pts_components = pts_component_manager_create();
+ imcv_pts_components->add_vendor(imcv_pts_components, PEN_TCG,
+ pts_tcg_comp_func_names, PTS_TCG_QUALIFIER_TYPE_SIZE,
+ pts_tcg_qualifier_flag_names, pts_tcg_qualifier_type_names);
+ imcv_pts_components->add_vendor(imcv_pts_components, PEN_ITA,
+ pts_ita_comp_func_names, PTS_ITA_QUALIFIER_TYPE_SIZE,
+ pts_ita_qualifier_flag_names, pts_ita_qualifier_type_names);
+
+ imcv_pts_components->add_component(imcv_pts_components, PEN_ITA,
+ PTS_ITA_COMP_FUNC_NAME_TGRUB,
+ pts_ita_comp_tgrub_create);
+ imcv_pts_components->add_component(imcv_pts_components, PEN_ITA,
+ PTS_ITA_COMP_FUNC_NAME_TBOOT,
+ pts_ita_comp_tboot_create);
+ imcv_pts_components->add_component(imcv_pts_components, PEN_ITA,
+ PTS_ITA_COMP_FUNC_NAME_IMA,
+ pts_ita_comp_ima_create);
if (is_imv)
{
/* instantiate global IMV session manager */
@@ -193,8 +229,13 @@ void libimcv_deinit(void)
{
if (ref_put(&libimcv_ref))
{
+ imcv_pts_components->remove_vendor(imcv_pts_components, PEN_TCG);
+ imcv_pts_components->remove_vendor(imcv_pts_components, PEN_ITA);
+ imcv_pts_components->destroy(imcv_pts_components);
+
imcv_pa_tnc_attributes->remove_vendor(imcv_pa_tnc_attributes, PEN_IETF);
imcv_pa_tnc_attributes->remove_vendor(imcv_pa_tnc_attributes, PEN_ITA);
+ imcv_pa_tnc_attributes->remove_vendor(imcv_pa_tnc_attributes, PEN_TCG);
DESTROY_IF(imcv_pa_tnc_attributes);
imcv_pa_tnc_attributes = NULL;
DESTROY_IF(imcv_db);