summaryrefslogtreecommitdiff
path: root/src/libimcv/tcg
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@corsac.net>2017-05-30 20:59:31 +0200
committerYves-Alexis Perez <corsac@corsac.net>2017-05-30 20:59:31 +0200
commitbba25e2ff6c4a193acb54560ea4417537bd2954e (patch)
tree9e074fe343f9ab6f5ce1e9c5142d9a6cf180fcda /src/libimcv/tcg
parent05ddd767992d68bb38c7f16ece142e8c2e9ae016 (diff)
downloadvyos-strongswan-bba25e2ff6c4a193acb54560ea4417537bd2954e.tar.gz
vyos-strongswan-bba25e2ff6c4a193acb54560ea4417537bd2954e.zip
New upstream version 5.5.3
Diffstat (limited to 'src/libimcv/tcg')
-rw-r--r--src/libimcv/tcg/pts/tcg_pts_attr_req_func_comp_evid.c28
-rw-r--r--src/libimcv/tcg/pts/tcg_pts_attr_simple_comp_evid.c4
2 files changed, 20 insertions, 12 deletions
diff --git a/src/libimcv/tcg/pts/tcg_pts_attr_req_func_comp_evid.c b/src/libimcv/tcg/pts/tcg_pts_attr_req_func_comp_evid.c
index da21003e3..0d8486756 100644
--- a/src/libimcv/tcg/pts/tcg_pts_attr_req_func_comp_evid.c
+++ b/src/libimcv/tcg/pts/tcg_pts_attr_req_func_comp_evid.c
@@ -115,18 +115,24 @@ struct entry_t {
pts_comp_func_name_t *name;
};
-/**
- * Enumerate functional component entries
- */
-static bool entry_filter(void *null, entry_t **entry, uint8_t *flags,
- void *i2, uint32_t *depth, void *i3,
- pts_comp_func_name_t **name)
+CALLBACK(entry_filter, bool,
+ void *null, enumerator_t *orig, va_list args)
{
- *flags = (*entry)->flags;
- *depth = (*entry)->depth;
- *name = (*entry)->name;
+ entry_t *entry;
+ pts_comp_func_name_t **name;
+ uint32_t *depth;
+ uint8_t *flags;
- return TRUE;
+ VA_ARGS_VGET(args, flags, depth, name);
+
+ if (orig->enumerate(orig, &entry))
+ {
+ *flags = entry->flags;
+ *depth = entry->depth;
+ *name = entry->name;
+ return TRUE;
+ }
+ return FALSE;
}
/**
@@ -318,7 +324,7 @@ METHOD(tcg_pts_attr_req_func_comp_evid_t, create_enumerator, enumerator_t*,
private_tcg_pts_attr_req_func_comp_evid_t *this)
{
return enumerator_create_filter(this->list->create_enumerator(this->list),
- (void*)entry_filter, NULL, NULL);
+ entry_filter, NULL, NULL);
}
/**
diff --git a/src/libimcv/tcg/pts/tcg_pts_attr_simple_comp_evid.c b/src/libimcv/tcg/pts/tcg_pts_attr_simple_comp_evid.c
index c249ca151..9438fa062 100644
--- a/src/libimcv/tcg/pts/tcg_pts_attr_simple_comp_evid.c
+++ b/src/libimcv/tcg/pts/tcg_pts_attr_simple_comp_evid.c
@@ -263,13 +263,15 @@ bool measurement_time_from_utc(time_t *measurement_time, chunk_t utc_time)
{
int tm_year, tm_mon, tm_day, tm_days, tm_hour, tm_min, tm_sec, tm_secs;
int tm_leap_4, tm_leap_100, tm_leap_400, tm_leap;
+ char buf[BUF_LEN];
if (memeq(utc_undefined_time_str, utc_time.ptr, utc_time.len))
{
*measurement_time = 0;
return TRUE;
}
- if (sscanf(utc_time.ptr, "%4d-%2d-%2dT%2d:%2d:%2dZ",
+ snprintf(buf, sizeof(buf), "%.*s", (int)utc_time.len, utc_time.ptr);
+ if (sscanf(buf, "%4d-%2d-%2dT%2d:%2d:%2dZ",
&tm_year, &tm_mon, &tm_day, &tm_hour, &tm_min, &tm_sec) != 6)
{
return FALSE;