summaryrefslogtreecommitdiff
path: root/src/libpts/pts/components
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2013-02-07 13:27:27 +0100
committerYves-Alexis Perez <corsac@debian.org>2013-02-07 13:27:27 +0100
commit7585facf05d927eb6df3929ce09ed5e60d905437 (patch)
treee4d14b4dc180db20356b6b01ce0112f3a2d7897e /src/libpts/pts/components
parentc1343b3278cdf99533b7902744d15969f9d6fdc1 (diff)
downloadvyos-strongswan-7585facf05d927eb6df3929ce09ed5e60d905437.tar.gz
vyos-strongswan-7585facf05d927eb6df3929ce09ed5e60d905437.zip
Imported Upstream version 5.0.2
Diffstat (limited to 'src/libpts/pts/components')
-rw-r--r--src/libpts/pts/components/ita/ita_comp_ima.c16
-rw-r--r--src/libpts/pts/components/ita/ita_comp_tboot.c8
-rw-r--r--src/libpts/pts/components/ita/ita_comp_tgrub.c8
-rw-r--r--src/libpts/pts/components/pts_comp_evidence.c4
-rw-r--r--src/libpts/pts/components/pts_comp_func_name.c2
-rw-r--r--src/libpts/pts/components/pts_component_manager.c10
6 files changed, 25 insertions, 23 deletions
diff --git a/src/libpts/pts/components/ita/ita_comp_ima.c b/src/libpts/pts/components/ita/ita_comp_ima.c
index a59732428..02470f5f5 100644
--- a/src/libpts/pts/components/ita/ita_comp_ima.c
+++ b/src/libpts/pts/components/ita/ita_comp_ima.c
@@ -20,7 +20,7 @@
#include "pts/pts_pcr.h"
#include "pts/components/pts_component.h"
-#include <debug.h>
+#include <utils/debug.h>
#include <pen/pen.h>
#include <sys/types.h>
@@ -96,12 +96,12 @@ struct pts_ita_comp_ima_t {
int ima_cid;
/**
- * Component is registering IMA BIOS measurements
+ * Component is registering IMA BIOS measurements
*/
bool is_bios_registering;
/**
- * Component is registering IMA boot aggregate measurement
+ * Component is registering IMA boot aggregate measurement
*/
bool is_ima_registering;
@@ -184,7 +184,7 @@ struct bios_entry_t {
/**
* SHA1 measurement hash
- */
+ */
chunk_t measurement;
};
@@ -291,6 +291,7 @@ static bool load_bios_measurements(char *file, linked_list_t *list,
DBG1(DBG_PTS, "loading bios measurements '%s' failed: %s", file,
strerror(errno));
+ free_bios_entry(entry);
close(fd);
return FALSE;
}
@@ -377,6 +378,7 @@ static bool load_runtime_measurements(char *file, linked_list_t *list,
DBG1(DBG_PTS, "loading ima measurements '%s' failed: %s",
file, strerror(errno));
+ free_ima_entry(entry);
close(fd);
return FALSE;
}
@@ -526,7 +528,7 @@ METHOD(pts_component_t, measure, status_t,
evid = extend_pcr(this, qualifier, pcrs, bios_entry->pcr,
bios_entry->measurement);
free(bios_entry);
-
+
this->state = this->bios_list->get_count(this->bios_list) ?
IMA_STATE_BIOS : IMA_STATE_INIT;
break;
@@ -821,7 +823,7 @@ METHOD(pts_component_t, finalize, bool,
u_int32_t vid, name;
enum_name_t *names;
bool success = TRUE;
-
+
this->name->set_qualifier(this->name, qualifier);
vid = this->name->get_vendor_id(this->name);
name = this->name->get_name(this->name);
@@ -915,7 +917,7 @@ METHOD(pts_component_t, destroy, void,
}
this->bios_list->destroy_function(this->bios_list,
(void *)free_bios_entry);
- this->ima_list->destroy_function(this->ima_list,
+ this->ima_list->destroy_function(this->ima_list,
(void *)free_ima_entry);
this->name->destroy(this->name);
free(this->keyid.ptr);
diff --git a/src/libpts/pts/components/ita/ita_comp_tboot.c b/src/libpts/pts/components/ita/ita_comp_tboot.c
index 9deeb19b5..8fb5abddf 100644
--- a/src/libpts/pts/components/ita/ita_comp_tboot.c
+++ b/src/libpts/pts/components/ita/ita_comp_tboot.c
@@ -19,7 +19,7 @@
#include "libpts.h"
#include "pts/components/pts_component.h"
-#include <debug.h>
+#include <utils/debug.h>
#include <pen/pen.h>
typedef struct pts_ita_comp_tboot_t pts_ita_comp_tboot_t;
@@ -66,7 +66,7 @@ struct pts_ita_comp_tboot_t {
int kid;
/**
- * Component is registering measurements
+ * Component is registering measurements
*/
bool is_registering;
@@ -123,7 +123,7 @@ METHOD(pts_component_t, measure, status_t,
char *meas_hex, *pcr_before_hex, *pcr_after_hex;
chunk_t measurement, pcr_before, pcr_after;
u_int32_t extended_pcr;
-
+
switch (this->seq_no++)
{
case 0:
@@ -286,7 +286,7 @@ METHOD(pts_component_t, finalize, bool,
{
u_int32_t vid, name;
enum_name_t *names;
-
+
vid = this->name->get_vendor_id(this->name);
name = this->name->get_name(this->name);
names = pts_components->get_comp_func_names(pts_components, vid);
diff --git a/src/libpts/pts/components/ita/ita_comp_tgrub.c b/src/libpts/pts/components/ita/ita_comp_tgrub.c
index 986f7ace2..e3acd8774 100644
--- a/src/libpts/pts/components/ita/ita_comp_tgrub.c
+++ b/src/libpts/pts/components/ita/ita_comp_tgrub.c
@@ -18,7 +18,7 @@
#include "pts/components/pts_component.h"
-#include <debug.h>
+#include <utils/debug.h>
#include <pen/pen.h>
typedef struct pts_ita_comp_tgrub_t pts_ita_comp_tgrub_t;
@@ -90,7 +90,7 @@ METHOD(pts_component_t, measure, status_t,
/* Provisional implementation for TGRUB */
extended_pcr = PCR_DEBUG;
time(&measurement_time);
-
+
if (!pts->read_pcr(pts, extended_pcr, &pcr_after))
{
DBG1(DBG_PTS, "error occurred while reading PCR: %d", extended_pcr);
@@ -103,7 +103,7 @@ METHOD(pts_component_t, measure, status_t,
measurement = chunk_alloc(pcr_len);
memset(measurement.ptr, 0x00, measurement.len);
-
+
pcr_before = chunk_alloc(pcr_len);
memset(pcr_before.ptr, 0x00, pcr_before.len);
@@ -150,7 +150,7 @@ METHOD(pts_component_t, verify, status_t,
return SUCCESS;
}
}
-
+
return SUCCESS;
}
diff --git a/src/libpts/pts/components/pts_comp_evidence.c b/src/libpts/pts/components/pts_comp_evidence.c
index 050717472..08c3d5e9a 100644
--- a/src/libpts/pts/components/pts_comp_evidence.c
+++ b/src/libpts/pts/components/pts_comp_evidence.c
@@ -15,7 +15,7 @@
#include "pts/components/pts_comp_evidence.h"
-#include <debug.h>
+#include <utils/debug.h>
typedef struct private_pts_comp_evidence_t private_pts_comp_evidence_t;
@@ -148,7 +148,7 @@ METHOD(pts_comp_evidence_t, get_pcr_info, bool,
METHOD(pts_comp_evidence_t, set_pcr_info, void,
private_pts_comp_evidence_t *this, chunk_t pcr_before, chunk_t pcr_after)
{
- this->has_pcr_info = TRUE;
+ this->has_pcr_info = TRUE;
this->pcr_before = pcr_before;
this->pcr_after = pcr_after;
diff --git a/src/libpts/pts/components/pts_comp_func_name.c b/src/libpts/pts/components/pts_comp_func_name.c
index 7501be044..6c630f8fb 100644
--- a/src/libpts/pts/components/pts_comp_func_name.c
+++ b/src/libpts/pts/components/pts_comp_func_name.c
@@ -17,7 +17,7 @@
#include "libpts.h"
#include "pts/components/pts_comp_func_name.h"
-#include <debug.h>
+#include <utils/debug.h>
typedef struct private_pts_comp_func_name_t private_pts_comp_func_name_t;
diff --git a/src/libpts/pts/components/pts_component_manager.c b/src/libpts/pts/components/pts_component_manager.c
index e330aeebf..9c1375b79 100644
--- a/src/libpts/pts/components/pts_component_manager.c
+++ b/src/libpts/pts/components/pts_component_manager.c
@@ -15,8 +15,8 @@
#include "pts/components/pts_component_manager.h"
-#include <utils/linked_list.h>
-#include <debug.h>
+#include <collections/linked_list.h>
+#include <utils/debug.h>
typedef struct private_pts_component_manager_t private_pts_component_manager_t;
typedef struct vendor_entry_t vendor_entry_t;
@@ -56,7 +56,7 @@ struct vendor_entry_t {
/**
* List of vendor-specific registered Functional Components
- */
+ */
linked_list_t *components;
};
@@ -103,7 +103,7 @@ struct private_pts_component_manager_t {
};
METHOD(pts_component_manager_t, add_vendor, void,
- private_pts_component_manager_t *this, pen_t vendor_id,
+ private_pts_component_manager_t *this, pen_t vendor_id,
enum_name_t *comp_func_names, int qualifier_type_size,
char *qualifier_flag_names, enum_name_t *qualifier_type_names)
{
@@ -285,7 +285,7 @@ METHOD(pts_component_manager_t, create, pts_component_t*,
METHOD(pts_component_manager_t, destroy, void,
private_pts_component_manager_t *this)
{
- this->list->destroy_function(this->list, (void *)vendor_entry_destroy);
+ this->list->destroy_function(this->list, (void *)vendor_entry_destroy);
free(this);
}