diff --git a/src/libimcv/Makefile.am b/src/libimcv/Makefile.am index 7b0266f8d..cd250a2fc 100644 --- a/src/libimcv/Makefile.am +++ b/src/libimcv/Makefile.am @@ -17,8 +17,6 @@ libimcv_la_SOURCES = \ pa_tnc/pa_tnc_msg.h pa_tnc/pa_tnc_msg.c \ pa_tnc/pa_tnc_attr.h pa_tnc/pa_tnc_attr.c \ tcg/tcg_attr.h tcg/tcg_attr.c \ - tcg/tcg_pts_funct_comp_name.h \ - tcg/tcg_pts_meas_algo.h tcg/tcg_pts_meas_algo.c \ tcg/tcg_pts_attr_proto_caps.h tcg/tcg_pts_attr_proto_caps.c \ tcg/tcg_pts_attr_meas_algo.h tcg/tcg_pts_attr_meas_algo.c \ tcg/tcg_pts_attr_get_tpm_version_info.h tcg/tcg_pts_attr_get_tpm_version_info.c \ @@ -30,7 +28,9 @@ libimcv_la_SOURCES = \ tcg/tcg_pts_attr_simple_comp_evid.h tcg/tcg_pts_attr_simple_comp_evid.c \ tcg/tcg_pts_attr_simple_evid_final.h tcg/tcg_pts_attr_simple_evid_final.c \ tcg/tcg_pts_attr_req_file_meas.h tcg/tcg_pts_attr_req_file_meas.c \ - tcg/tcg_pts_attr_file_meas.h tcg/tcg_pts_attr_file_meas.c + tcg/tcg_pts_attr_file_meas.h tcg/tcg_pts_attr_file_meas.c \ + tcg/pts/pts_funct_comp_name.h \ + tcg/pts/pts_meas_algo.h tcg/pts/pts_meas_algo.c # CFLAGS = -Wall -Werror diff --git a/src/libimcv/plugins/imc_attestation/imc_attestation.c b/src/libimcv/plugins/imc_attestation/imc_attestation.c index 3b6b0ce9c..87f5b454d 100644 --- a/src/libimcv/plugins/imc_attestation/imc_attestation.c +++ b/src/libimcv/plugins/imc_attestation/imc_attestation.c @@ -107,8 +107,7 @@ TNC_Result TNC_IMC_Initialize(TNC_IMCID imc_id, } imc_attestation = imc_agent_create(imc_name, IMC_VENDOR_ID, IMC_SUBTYPE, imc_id, actual_version); - if (!imc_attestation || - !tcg_pts_probe_meas_algorithms(&supported_algorithms)) + if (!imc_attestation || !pts_meas_probe_algorithms(&supported_algorithms)) { return TNC_RESULT_FATAL; } @@ -201,7 +200,7 @@ static TNC_Result hash_file(char *path, char *out) hash_algorithm_t hash_alg; /* Create a hasher */ - hash_alg = tcg_pts_meas_to_hash_algorithm(selected_algorithm); + hash_alg = pts_meas_to_hash_algorithm(selected_algorithm); hasher = lib->crypto->create_hasher(lib->crypto, hash_alg); if (!hasher) { diff --git a/src/libimcv/plugins/imv_attestation/imv_attestation.c b/src/libimcv/plugins/imv_attestation/imv_attestation.c index e119369ba..f9f10e409 100644 --- a/src/libimcv/plugins/imv_attestation/imv_attestation.c +++ b/src/libimcv/plugins/imv_attestation/imv_attestation.c @@ -101,8 +101,7 @@ TNC_Result TNC_IMV_Initialize(TNC_IMVID imv_id, } imv_attestation = imv_agent_create(imv_name, IMV_VENDOR_ID, IMV_SUBTYPE, imv_id, actual_version); - if (!imv_attestation || - !tcg_pts_probe_meas_algorithms(&supported_algorithms)) + if (!imv_attestation || !pts_meas_probe_algorithms(&supported_algorithms)) { return TNC_RESULT_FATAL; } diff --git a/src/libimcv/tcg/tcg_pts_funct_comp_name.h b/src/libimcv/tcg/pts/pts_funct_comp_name.h similarity index 95% rename from src/libimcv/tcg/tcg_pts_funct_comp_name.h rename to src/libimcv/tcg/pts/pts_funct_comp_name.h index 68e0edcf0..e411cf5ce 100644 --- a/src/libimcv/tcg/tcg_pts_funct_comp_name.h +++ b/src/libimcv/tcg/pts/pts_funct_comp_name.h @@ -18,8 +18,8 @@ * @{ @ingroup tcg_pts_attr_req_funct_comp_evid */ -#ifndef TCG_PTS_FUNCT_COMP_NAME_H_ -#define TCG_PTS_FUNCT_COMP_NAME_H_ +#ifndef PTS_FUNCT_COMP_NAME_H_ +#define PTS_FUNCT_COMP_NAME_H_ typedef enum pts_funct_comp_type_t pts_funct_comp_type_t; typedef enum pts_funct_comp_name_t pts_funct_comp_name_t; @@ -78,4 +78,4 @@ struct pts_qualifier_t { pts_funct_comp_type_t type; }; -#endif /** TCG_PTS_FUNCT_COMP_NAME_H_ @}*/ +#endif /** PTS_FUNCT_COMP_NAME_H_ @}*/ diff --git a/src/libimcv/tcg/tcg_pts_meas_algo.c b/src/libimcv/tcg/pts/pts_meas_algo.c similarity index 92% rename from src/libimcv/tcg/tcg_pts_meas_algo.c rename to src/libimcv/tcg/pts/pts_meas_algo.c index a5f0a004b..1a929cfc7 100644 --- a/src/libimcv/tcg/tcg_pts_meas_algo.c +++ b/src/libimcv/tcg/pts/pts_meas_algo.c @@ -13,14 +13,14 @@ * for more details. */ -#include "tcg_pts_meas_algo.h" +#include "pts_meas_algo.h" #include /** * Described in header. */ -bool tcg_pts_probe_meas_algorithms(pts_meas_algorithms_t *algorithms) +bool pts_meas_probe_algorithms(pts_meas_algorithms_t *algorithms) { enumerator_t *enumerator; hash_algorithm_t hash_alg; @@ -77,7 +77,7 @@ bool tcg_pts_probe_meas_algorithms(pts_meas_algorithms_t *algorithms) /** * Described in header. */ -hash_algorithm_t tcg_pts_meas_to_hash_algorithm(pts_meas_algorithms_t algorithm) +hash_algorithm_t pts_meas_to_hash_algorithm(pts_meas_algorithms_t algorithm) { switch (algorithm) { diff --git a/src/libimcv/tcg/tcg_pts_meas_algo.h b/src/libimcv/tcg/pts/pts_meas_algo.h similarity index 87% rename from src/libimcv/tcg/tcg_pts_meas_algo.h rename to src/libimcv/tcg/pts/pts_meas_algo.h index 09e402fd7..6fbac93a4 100644 --- a/src/libimcv/tcg/tcg_pts_meas_algo.h +++ b/src/libimcv/tcg/pts/pts_meas_algo.h @@ -18,8 +18,8 @@ * @{ @ingroup tcg_pts_meas_algo */ -#ifndef TCG_PTS_MEAS_ALGO_H_ -#define TCG_PTS_MEAS_ALGO_H_ +#ifndef PTS_MEAS_ALGO_H_ +#define PTS_MEAS_ALGO_H_ #include #include @@ -53,7 +53,7 @@ enum pts_meas_algorithms_t { * @param algorithms set of available algorithms * @return TRUE if mandatory algorithms are available */ -bool tcg_pts_probe_meas_algorithms(pts_meas_algorithms_t *algorithms); +bool pts_meas_probe_algorithms(pts_meas_algorithms_t *algorithms); /** * Convert pts_meas_algorithms_t to hash_algorithm_t @@ -61,6 +61,6 @@ bool tcg_pts_probe_meas_algorithms(pts_meas_algorithms_t *algorithms); * @param algorithm PTS measurement algorithm type * @return libstrongswan hash algorithm type */ -hash_algorithm_t tcg_pts_meas_to_hash_algorithm(pts_meas_algorithms_t algorithm); +hash_algorithm_t pts_meas_to_hash_algorithm(pts_meas_algorithms_t algorithm); -#endif /** TCG_PTS_MEAS_ALGO_H_ @}*/ +#endif /** PTS_MEAS_ALGO_H_ @}*/ diff --git a/src/libimcv/tcg/tcg_pts_attr_meas_algo.h b/src/libimcv/tcg/tcg_pts_attr_meas_algo.h index 95a582560..885e2c16b 100644 --- a/src/libimcv/tcg/tcg_pts_attr_meas_algo.h +++ b/src/libimcv/tcg/tcg_pts_attr_meas_algo.h @@ -24,7 +24,7 @@ typedef struct tcg_pts_attr_meas_algo_t tcg_pts_attr_meas_algo_t; #include "tcg_attr.h" -#include "tcg_pts_meas_algo.h" +#include "pts/pts_meas_algo.h" #include "pa_tnc/pa_tnc_attr.h" /** diff --git a/src/libimcv/tcg/tcg_pts_attr_req_funct_comp_evid.h b/src/libimcv/tcg/tcg_pts_attr_req_funct_comp_evid.h index e41b3ab15..72d455969 100644 --- a/src/libimcv/tcg/tcg_pts_attr_req_funct_comp_evid.h +++ b/src/libimcv/tcg/tcg_pts_attr_req_funct_comp_evid.h @@ -25,7 +25,7 @@ typedef struct tcg_pts_attr_req_funct_comp_evid_t tcg_pts_attr_req_funct_comp_ev typedef enum pts_attr_req_funct_comp_evid_flag_t pts_attr_req_funct_comp_evid_flag_t; #include "tcg_attr.h" -#include "tcg_pts_funct_comp_name.h" +#include "pts/pts_funct_comp_name.h" #include "pa_tnc/pa_tnc_attr.h" /** diff --git a/src/libimcv/tcg/tcg_pts_attr_simple_comp_evid.h b/src/libimcv/tcg/tcg_pts_attr_simple_comp_evid.h index 94fe013c4..2ed92170b 100644 --- a/src/libimcv/tcg/tcg_pts_attr_simple_comp_evid.h +++ b/src/libimcv/tcg/tcg_pts_attr_simple_comp_evid.h @@ -26,8 +26,8 @@ typedef enum pts_attr_simple_comp_evid_flag_t pts_attr_simple_comp_evid_flag_t; typedef enum pts_pcr_transform_t pts_pcr_transform_t; #include "tcg_attr.h" -#include "tcg_pts_meas_algo.h" -#include "tcg_pts_funct_comp_name.h" +#include "pts/pts_meas_algo.h" +#include "pts/pts_funct_comp_name.h" #include "pa_tnc/pa_tnc_attr.h" /**