diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2011-10-30 22:20:20 +0100 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2011-11-28 19:48:31 +0100 |
commit | 9b6473bb246d3911dd4a1053c324e59aec9da3c7 (patch) | |
tree | 26a47f9cf52ee33990380662c8d60badae393b28 /src | |
parent | d8399b8b85a37f8dc96b22843208aa63606a435f (diff) | |
download | strongswan-9b6473bb246d3911dd4a1053c324e59aec9da3c7.tar.bz2 strongswan-9b6473bb246d3911dd4a1053c324e59aec9da3c7.tar.xz |
refactored attest database tool
Diffstat (limited to 'src')
-rw-r--r-- | src/libimcv/plugins/imv_attestation/attest.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/src/libimcv/plugins/imv_attestation/attest.c b/src/libimcv/plugins/imv_attestation/attest.c index d2aa52fa7..531cd532e 100644 --- a/src/libimcv/plugins/imv_attestation/attest.c +++ b/src/libimcv/plugins/imv_attestation/attest.c @@ -112,6 +112,12 @@ static void do_args(int argc, char *argv[]) case 'H': operation = OP_HASHES; continue; + case 'D': + if (!attest->set_directory(attest, optarg)) + { + exit(EXIT_FAILURE); + } + continue; case 'F': if (!attest->set_file(attest, optarg, op == OP_ADD)) { @@ -176,33 +182,12 @@ static void do_args(int argc, char *argv[]) attest->delete(attest); break; case OP_HASHES: - if ((!product || *product == '\0') && (!file || *file == '\0')) - { - list_hashes(algo); - } - else if (product) - { - list_hashes_for_product(algo, product, pid); - } - else - { - list_hashes_for_file(algo, file, fid); - } + attest->list_hashes(attest); break; default: usage(); exit(EXIT_FAILURE); } - - if (fid) - { - free(file); - } - if (pid) - { - free(product); - } - } int main(int argc, char *argv[]) |