libimcv: Fixed processing of PTS Simple Component Evidence
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2011-2012 Sansar Choinyambuu
|
* Copyright (C) 2011-2012 Sansar Choinyambuu
|
||||||
* Copyright (C) 2011-2014 Andreas Steffen
|
* Copyright (C) 2011-2018 Andreas Steffen
|
||||||
* HSR Hochschule fuer Technik Rapperswil
|
* HSR Hochschule fuer Technik Rapperswil
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
@@ -278,12 +278,24 @@ bool measurement_time_from_utc(time_t *measurement_time, chunk_t utc_time)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* representation of months as 0..11 */
|
/* representation of months as 0..11 */
|
||||||
|
if (tm_mon < 1 || tm_mon > 12)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
tm_mon--;
|
tm_mon--;
|
||||||
|
|
||||||
/* representation of days as 0..30 */
|
/* representation of days as 0..30 */
|
||||||
|
if (tm_day < 1 || tm_day > 31)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
tm_day--;
|
tm_day--;
|
||||||
|
|
||||||
/* number of leap years between last year and 1970? */
|
/* number of leap years between last year and 1970? */
|
||||||
|
if (tm_year < 1970)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
tm_leap_4 = (tm_year - 1) / 4;
|
tm_leap_4 = (tm_year - 1) / 4;
|
||||||
tm_leap_100 = tm_leap_4 / 25;
|
tm_leap_100 = tm_leap_4 / 25;
|
||||||
tm_leap_400 = tm_leap_100 / 4;
|
tm_leap_400 = tm_leap_100 / 4;
|
||||||
@@ -325,6 +337,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
|
|||||||
if (this->value.len < PTS_SIMPLE_COMP_EVID_SIZE)
|
if (this->value.len < PTS_SIMPLE_COMP_EVID_SIZE)
|
||||||
{
|
{
|
||||||
DBG1(DBG_TNC, "insufficient data for Simple Component Evidence");
|
DBG1(DBG_TNC, "insufficient data for Simple Component Evidence");
|
||||||
|
return FAILED;
|
||||||
}
|
}
|
||||||
reader = bio_reader_create(this->value);
|
reader = bio_reader_create(this->value);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user