strongswan.org
Wiki/Project Management
Downloads
Gitweb
projects
/
strongswan.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2b61f7b
)
attest displays dates either in local time or UTC
author
Andreas Steffen
<andreas.steffen@strongswan.org>
Fri, 30 Nov 2012 08:55:38 +0000
(09:55 +0100)
committer
Andreas Steffen
<andreas.steffen@strongswan.org>
Fri, 30 Nov 2012 08:55:38 +0000
(09:55 +0100)
src/libpts/plugins/imv_attestation/attest.c
patch
|
blob
|
history
src/libpts/plugins/imv_attestation/attest_db.c
patch
|
blob
|
history
src/libpts/plugins/imv_attestation/attest_db.h
patch
|
blob
|
history
src/libpts/plugins/imv_attestation/attest_usage.c
patch
|
blob
|
history
diff --git
a/src/libpts/plugins/imv_attestation/attest.c
b/src/libpts/plugins/imv_attestation/attest.c
index
5cfc073
..
1cdacae
100644
(file)
--- a/
src/libpts/plugins/imv_attestation/attest.c
+++ b/
src/libpts/plugins/imv_attestation/attest.c
@@
-145,6
+145,7
@@
static void do_args(int argc, char *argv[])
{ "rel", no_argument, NULL, 'R' },
{ "sequence", required_argument, NULL, 'S' },
{ "seq", required_argument, NULL, 'S' },
{ "rel", no_argument, NULL, 'R' },
{ "sequence", required_argument, NULL, 'S' },
{ "seq", required_argument, NULL, 'S' },
+ { "utc", no_argument, NULL, 'U' },
{ "version", required_argument, NULL, 'V' },
{ "security", no_argument, NULL, 'Y' },
{ "sha1", no_argument, NULL, '1' },
{ "version", required_argument, NULL, 'V' },
{ "security", no_argument, NULL, 'Y' },
{ "sha1", no_argument, NULL, '1' },
@@
-290,6
+291,9
@@
static void do_args(int argc, char *argv[])
case 'S':
attest->set_sequence(attest, atoi(optarg));
continue;
case 'S':
attest->set_sequence(attest, atoi(optarg));
continue;
+ case 'U':
+ attest->set_utc(attest);
+ continue;
case 'V':
if (!attest->set_version(attest, optarg))
{
case 'V':
if (!attest->set_version(attest, optarg))
{
diff --git
a/src/libpts/plugins/imv_attestation/attest_db.c
b/src/libpts/plugins/imv_attestation/attest_db.c
index
68a114c
..
4c814bf
100644
(file)
--- a/
src/libpts/plugins/imv_attestation/attest_db.c
+++ b/
src/libpts/plugins/imv_attestation/attest_db.c
@@
-143,6
+143,11
@@
struct private_attest_db_t {
bool relative;
/**
bool relative;
/**
+ * TRUE if dates are to be displayed in UTC
+ */
+ bool utc;
+
+ /**
* Package security state
*/
os_package_state_t security;
* Package security state
*/
os_package_state_t security;
@@
-740,6
+745,12
@@
METHOD(attest_db_t, set_owner, void,
this->owner = strdup(owner);
}
this->owner = strdup(owner);
}
+METHOD(attest_db_t, set_utc, void,
+ private_attest_db_t *this)
+{
+ this->utc = TRUE;
+}
+
METHOD(attest_db_t, list_components, void,
private_attest_db_t *this)
{
METHOD(attest_db_t, list_components, void,
private_attest_db_t *this)
{
@@
-821,7
+832,7
@@
METHOD(attest_db_t, list_devices, void,
last_id = id;
}
timestamp = tstamp;
last_id = id;
}
timestamp = tstamp;
- printf(" %T, %4d, %3d, %3d, %1u, '%s'\n", ×tamp,
TRUE
,
+ printf(" %T, %4d, %3d, %3d, %1u, '%s'\n", ×tamp,
this->utc
,
count, count_update, count_blacklist, flags, product);
}
e->destroy(e);
count, count_update, count_blacklist, flags, product);
}
e->destroy(e);
@@
-965,7
+976,7
@@
METHOD(attest_db_t, list_packages, void,
printf(" ");
}
}
printf(" ");
}
}
- printf(" %T (%s)%N\n", &t,
TRUE
, version,
+ printf(" %T (%s)%N\n", &t,
this->utc
, version,
os_package_state_names, security);
count++;
}
os_package_state_names, security);
count++;
}
@@
-1718,6
+1729,7
@@
attest_db_t *attest_db_create(char *uri)
.set_security = _set_security,
.set_sequence = _set_sequence,
.set_owner = _set_owner,
.set_security = _set_security,
.set_sequence = _set_sequence,
.set_owner = _set_owner,
+ .set_utc = _set_utc,
.list_packages = _list_packages,
.list_products = _list_products,
.list_files = _list_files,
.list_packages = _list_packages,
.list_products = _list_products,
.list_files = _list_files,
diff --git
a/src/libpts/plugins/imv_attestation/attest_db.h
b/src/libpts/plugins/imv_attestation/attest_db.h
index
471b0a2
..
e2297d0
100644
(file)
--- a/
src/libpts/plugins/imv_attestation/attest_db.h
+++ b/
src/libpts/plugins/imv_attestation/attest_db.h
@@
-179,6
+179,11
@@
struct attest_db_t {
void (*set_owner)(attest_db_t *this, char *owner);
/**
void (*set_owner)(attest_db_t *this, char *owner);
/**
+ * Display all dates in UTC
+ */
+ void (*set_utc)(attest_db_t *this);
+
+ /**
* List all packages stored in the database
*/
void (*list_packages)(attest_db_t *this);
* List all packages stored in the database
*/
void (*list_packages)(attest_db_t *this);
diff --git
a/src/libpts/plugins/imv_attestation/attest_usage.c
b/src/libpts/plugins/imv_attestation/attest_usage.c
index
df44c17
..
324fcaf
100644
(file)
--- a/
src/libpts/plugins/imv_attestation/attest_usage.c
+++ b/
src/libpts/plugins/imv_attestation/attest_usage.c
@@
-24,16
+24,19
@@
void usage(void)
{
printf("\
Usage:\n\
{
printf("\
Usage:\n\
- ipsec attest --
files|--products|--keys|--hashe
s [options]\n\
+ ipsec attest --
components|--devices|--files|--hashes|--key
s [options]\n\
\n\
\n\
- ipsec attest --
components|-keys|--measuremen
ts|--add|--del [options]\n\
+ ipsec attest --
measurements|--packages|--produc
ts|--add|--del [options]\n\
\n\
\n\
- ipsec attest --
files [--product <name>|--p
id <id>]\n\
- Show a list of
files with a software product name
or\n\
+ ipsec attest --
components [--key <digest>|--k
id <id>]\n\
+ Show a list of
components with an AIK digest
or\n\
its primary key as an optional selector.\n\
\n\
its primary key as an optional selector.\n\
\n\
- ipsec attest --products [--file <path>|--fid <id>]\n\
- Show a list of supported software products with a file path or\n\
+ ipsec attest --devices [--utc]\n\
+ Show a list of registered devices and associated collected information\n\
+ \n\
+ ipsec attest --files [--product <name>|--pid <id>]\n\
+ Show a list of files with a software product name or\n\
its primary key as an optional selector.\n\
\n\
ipsec attest --hashes [--sha1|--sha256|--sha384] [--product <name>|--pid <id>]\n\
its primary key as an optional selector.\n\
\n\
ipsec attest --hashes [--sha1|--sha256|--sha384] [--product <name>|--pid <id>]\n\
@@
-44,10
+47,6
@@
Usage:\n\
Show a list of measurement hashes for a given file or\n\
its primary key as an optional selector.\n\
\n\
Show a list of measurement hashes for a given file or\n\
its primary key as an optional selector.\n\
\n\
- ipsec attest --components [--key <digest>|--kid <id>]\n\
- Show a list of components with an AIK digest or\n\
- its primary key as an optional selector.\n\
- \n\
ipsec attest --keys [--components <cfn>|--cid <id>]\n\
Show a list of AIK key digests with a component or\n\
its primary key as an optional selector.\n\
ipsec attest --keys [--components <cfn>|--cid <id>]\n\
Show a list of AIK key digests with a component or\n\
its primary key as an optional selector.\n\
@@
-60,12
+59,13
@@
Usage:\n\
Show a list of component measurements for a given AIK or\n\
its primary key as an optional selector.\n\
\n\
Show a list of component measurements for a given AIK or\n\
its primary key as an optional selector.\n\
\n\
- ipsec attest --packages [--product <name>|--pid <id>]\n\
+ ipsec attest --packages [--product <name>|--pid <id>]
[--utc]
\n\
Show a list of software packages for a given product or\n\
its primary key as an optional selector.\n\
\n\
Show a list of software packages for a given product or\n\
its primary key as an optional selector.\n\
\n\
- ipsec attest --devices\n\
- Show a list of registered devices and associated collected information\n\
+ ipsec attest --products [--file <path>|--fid <id>]\n\
+ Show a list of supported software products with a file path or\n\
+ its primary key as an optional selector.\n\
\n\
ipsec attest --add --file <path>|--dir <path>|--product <name>|--component <cfn>\n\
Add a file, directory, product or component entry\n\
\n\
ipsec attest --add --file <path>|--dir <path>|--product <name>|--component <cfn>\n\
Add a file, directory, product or component entry\n\