shortened function names and moved to pts subdirectory

This commit is contained in:
Andreas Steffen
2011-09-08 12:08:12 +02:00
parent 51038ba61c
commit 05f03238fa
9 changed files with 21 additions and 23 deletions
+3 -3
View File
@@ -17,8 +17,6 @@ libimcv_la_SOURCES = \
pa_tnc/pa_tnc_msg.h pa_tnc/pa_tnc_msg.c \ pa_tnc/pa_tnc_msg.h pa_tnc/pa_tnc_msg.c \
pa_tnc/pa_tnc_attr.h pa_tnc/pa_tnc_attr.c \ pa_tnc/pa_tnc_attr.h pa_tnc/pa_tnc_attr.c \
tcg/tcg_attr.h tcg/tcg_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_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_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 \ 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_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_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_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 # CFLAGS = -Wall -Werror
@@ -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_attestation = imc_agent_create(imc_name, IMC_VENDOR_ID, IMC_SUBTYPE,
imc_id, actual_version); imc_id, actual_version);
if (!imc_attestation || if (!imc_attestation || !pts_meas_probe_algorithms(&supported_algorithms))
!tcg_pts_probe_meas_algorithms(&supported_algorithms))
{ {
return TNC_RESULT_FATAL; return TNC_RESULT_FATAL;
} }
@@ -201,7 +200,7 @@ static TNC_Result hash_file(char *path, char *out)
hash_algorithm_t hash_alg; hash_algorithm_t hash_alg;
/* Create a hasher */ /* 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); hasher = lib->crypto->create_hasher(lib->crypto, hash_alg);
if (!hasher) if (!hasher)
{ {
@@ -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_attestation = imv_agent_create(imv_name, IMV_VENDOR_ID, IMV_SUBTYPE,
imv_id, actual_version); imv_id, actual_version);
if (!imv_attestation || if (!imv_attestation || !pts_meas_probe_algorithms(&supported_algorithms))
!tcg_pts_probe_meas_algorithms(&supported_algorithms))
{ {
return TNC_RESULT_FATAL; return TNC_RESULT_FATAL;
} }
@@ -18,8 +18,8 @@
* @{ @ingroup tcg_pts_attr_req_funct_comp_evid * @{ @ingroup tcg_pts_attr_req_funct_comp_evid
*/ */
#ifndef TCG_PTS_FUNCT_COMP_NAME_H_ #ifndef PTS_FUNCT_COMP_NAME_H_
#define TCG_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_type_t pts_funct_comp_type_t;
typedef enum pts_funct_comp_name_t pts_funct_comp_name_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; pts_funct_comp_type_t type;
}; };
#endif /** TCG_PTS_FUNCT_COMP_NAME_H_ @}*/ #endif /** PTS_FUNCT_COMP_NAME_H_ @}*/
@@ -13,14 +13,14 @@
* for more details. * for more details.
*/ */
#include "tcg_pts_meas_algo.h" #include "pts_meas_algo.h"
#include <debug.h> #include <debug.h>
/** /**
* Described in header. * 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; enumerator_t *enumerator;
hash_algorithm_t hash_alg; hash_algorithm_t hash_alg;
@@ -77,7 +77,7 @@ bool tcg_pts_probe_meas_algorithms(pts_meas_algorithms_t *algorithms)
/** /**
* Described in header. * 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) switch (algorithm)
{ {
@@ -18,8 +18,8 @@
* @{ @ingroup tcg_pts_meas_algo * @{ @ingroup tcg_pts_meas_algo
*/ */
#ifndef TCG_PTS_MEAS_ALGO_H_ #ifndef PTS_MEAS_ALGO_H_
#define TCG_PTS_MEAS_ALGO_H_ #define PTS_MEAS_ALGO_H_
#include <library.h> #include <library.h>
#include <crypto/hashers/hasher.h> #include <crypto/hashers/hasher.h>
@@ -53,7 +53,7 @@ enum pts_meas_algorithms_t {
* @param algorithms set of available algorithms * @param algorithms set of available algorithms
* @return TRUE if mandatory algorithms are available * @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 * 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 * @param algorithm PTS measurement algorithm type
* @return libstrongswan hash 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_ @}*/
+1 -1
View File
@@ -24,7 +24,7 @@
typedef struct tcg_pts_attr_meas_algo_t tcg_pts_attr_meas_algo_t; typedef struct tcg_pts_attr_meas_algo_t tcg_pts_attr_meas_algo_t;
#include "tcg_attr.h" #include "tcg_attr.h"
#include "tcg_pts_meas_algo.h" #include "pts/pts_meas_algo.h"
#include "pa_tnc/pa_tnc_attr.h" #include "pa_tnc/pa_tnc_attr.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; typedef enum pts_attr_req_funct_comp_evid_flag_t pts_attr_req_funct_comp_evid_flag_t;
#include "tcg_attr.h" #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" #include "pa_tnc/pa_tnc_attr.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; typedef enum pts_pcr_transform_t pts_pcr_transform_t;
#include "tcg_attr.h" #include "tcg_attr.h"
#include "tcg_pts_meas_algo.h" #include "pts/pts_meas_algo.h"
#include "tcg_pts_funct_comp_name.h" #include "pts/pts_funct_comp_name.h"
#include "pa_tnc/pa_tnc_attr.h" #include "pa_tnc/pa_tnc_attr.h"
/** /**