Moved debug.[ch] to utils folder

This commit is contained in:
Tobias Brunner
2012-10-24 16:00:51 +02:00
parent d5c143e5be
commit f05b427265
306 changed files with 445 additions and 443 deletions
+1 -1
View File
@@ -23,7 +23,7 @@
#include "pts/components/ita/ita_comp_tgrub.h"
#include <imcv.h>
#include <debug.h>
#include <utils/debug.h>
/**
* PTS Functional Component manager
@@ -36,7 +36,7 @@
#include <tncif_pa_subtypes.h>
#include <pen/pen.h>
#include <debug.h>
#include <utils/debug.h>
#include <collections/linked_list.h>
/* IMC definitions */
@@ -43,7 +43,7 @@
#include <tcg/tcg_pts_attr_req_file_meta.h>
#include <tcg/tcg_pts_attr_unix_file_meta.h>
#include <debug.h>
#include <utils/debug.h>
#include <utils/lexparser.h>
#define DEFAULT_NONCE_LEN 20
@@ -173,7 +173,7 @@ bool imc_attestation_process(pa_tnc_attr_t *attr, imc_msg_t *msg,
"have differing lengths");
return FALSE;
}
pts->set_peer_public_value(pts, initiator_value, initiator_nonce);
if (!pts->calculate_secret(pts))
{
@@ -334,7 +334,7 @@ bool imc_attestation_process(pa_tnc_attr_t *attr, imc_msg_t *msg,
u_int8_t flags;
status_t status;
enumerator_t *e;
attr_info = attr->get_value(attr);
attr_cast = (tcg_pts_attr_req_func_comp_evid_t*)attr;
@@ -350,7 +350,7 @@ bool imc_attestation_process(pa_tnc_attr_t *attr, imc_msg_t *msg,
if (flags & PTS_REQ_FUNC_COMP_EVID_TTC)
{
error_code = pen_type_create(PEN_TCG,
TCG_PTS_UNABLE_DET_TTC);
TCG_PTS_UNABLE_DET_TTC);
attr = ietf_attr_pa_tnc_error_create(error_code, attr_info);
msg->add_attribute(msg, attr);
break;
@@ -20,7 +20,7 @@
#include <tncif_names.h>
#include <collections/linked_list.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_imc_attestation_state_t private_imc_attestation_state_t;
typedef struct func_comp_t func_comp_t;
+1 -1
View File
@@ -22,7 +22,7 @@
#include <syslog.h>
#include <library.h>
#include <debug.h>
#include <utils/debug.h>
#include <imcv.h>
#include <libpts.h>
@@ -36,7 +36,7 @@
#include <tncif_pa_subtypes.h>
#include <pen/pen.h>
#include <debug.h>
#include <utils/debug.h>
#include <credentials/credential_manager.h>
#include <collections/linked_list.h>
@@ -27,7 +27,7 @@
#include <tcg/tcg_pts_attr_req_file_meas.h>
#include <tcg/tcg_pts_attr_req_file_meta.h>
#include <debug.h>
#include <utils/debug.h>
bool imv_attestation_build(imv_msg_t *out_msg,
imv_attestation_state_t *attestation_state,
@@ -177,7 +177,7 @@ bool imv_attestation_build(imv_msg_t *out_msg,
have_request = TRUE;
}
enumerator->destroy(enumerator);
/* Send Request File Measurement attribute */
enumerator = pts_db->create_file_meas_enumerator(pts_db,
platform_info);
@@ -29,7 +29,7 @@
#include <tcg/tcg_pts_attr_tpm_version_info.h>
#include <tcg/tcg_pts_attr_unix_file_meta.h>
#include <debug.h>
#include <utils/debug.h>
#include <crypto/hashers/hasher.h>
#include <inttypes.h>
@@ -43,7 +43,7 @@ bool imv_attestation_process(pa_tnc_attr_t *attr, imv_msg_t *out_msg,
{
pen_type_t attr_type;
pts_t *pts;
pts = attestation_state->get_pts(attestation_state);
attr_type = attr->get_type(attr);
@@ -19,7 +19,7 @@
#include <utils/lexparser.h>
#include <collections/linked_list.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_imv_attestation_state_t private_imv_attestation_state_t;
typedef struct file_meas_request_t file_meas_request_t;
+7 -7
View File
@@ -20,7 +20,7 @@
#include "pts/pts_pcr.h"
#include "pts/components/pts_component.h"
#include <debug.h>
#include <utils/debug.h>
#include <pen/pen.h>
#include <sys/types.h>
@@ -96,12 +96,12 @@ struct pts_ita_comp_ima_t {
int ima_cid;
/**
* Component is registering IMA BIOS measurements
* Component is registering IMA BIOS measurements
*/
bool is_bios_registering;
/**
* Component is registering IMA boot aggregate measurement
* Component is registering IMA boot aggregate measurement
*/
bool is_ima_registering;
@@ -184,7 +184,7 @@ struct bios_entry_t {
/**
* SHA1 measurement hash
*/
*/
chunk_t measurement;
};
@@ -528,7 +528,7 @@ METHOD(pts_component_t, measure, status_t,
evid = extend_pcr(this, qualifier, pcrs, bios_entry->pcr,
bios_entry->measurement);
free(bios_entry);
this->state = this->bios_list->get_count(this->bios_list) ?
IMA_STATE_BIOS : IMA_STATE_INIT;
break;
@@ -823,7 +823,7 @@ METHOD(pts_component_t, finalize, bool,
u_int32_t vid, name;
enum_name_t *names;
bool success = TRUE;
this->name->set_qualifier(this->name, qualifier);
vid = this->name->get_vendor_id(this->name);
name = this->name->get_name(this->name);
@@ -917,7 +917,7 @@ METHOD(pts_component_t, destroy, void,
}
this->bios_list->destroy_function(this->bios_list,
(void *)free_bios_entry);
this->ima_list->destroy_function(this->ima_list,
this->ima_list->destroy_function(this->ima_list,
(void *)free_ima_entry);
this->name->destroy(this->name);
free(this->keyid.ptr);
@@ -19,7 +19,7 @@
#include "libpts.h"
#include "pts/components/pts_component.h"
#include <debug.h>
#include <utils/debug.h>
#include <pen/pen.h>
typedef struct pts_ita_comp_tboot_t pts_ita_comp_tboot_t;
@@ -66,7 +66,7 @@ struct pts_ita_comp_tboot_t {
int kid;
/**
* Component is registering measurements
* Component is registering measurements
*/
bool is_registering;
@@ -123,7 +123,7 @@ METHOD(pts_component_t, measure, status_t,
char *meas_hex, *pcr_before_hex, *pcr_after_hex;
chunk_t measurement, pcr_before, pcr_after;
u_int32_t extended_pcr;
switch (this->seq_no++)
{
case 0:
@@ -286,7 +286,7 @@ METHOD(pts_component_t, finalize, bool,
{
u_int32_t vid, name;
enum_name_t *names;
vid = this->name->get_vendor_id(this->name);
name = this->name->get_name(this->name);
names = pts_components->get_comp_func_names(pts_components, vid);
@@ -18,7 +18,7 @@
#include "pts/components/pts_component.h"
#include <debug.h>
#include <utils/debug.h>
#include <pen/pen.h>
typedef struct pts_ita_comp_tgrub_t pts_ita_comp_tgrub_t;
@@ -90,7 +90,7 @@ METHOD(pts_component_t, measure, status_t,
/* Provisional implementation for TGRUB */
extended_pcr = PCR_DEBUG;
time(&measurement_time);
if (!pts->read_pcr(pts, extended_pcr, &pcr_after))
{
DBG1(DBG_PTS, "error occurred while reading PCR: %d", extended_pcr);
@@ -103,7 +103,7 @@ METHOD(pts_component_t, measure, status_t,
measurement = chunk_alloc(pcr_len);
memset(measurement.ptr, 0x00, measurement.len);
pcr_before = chunk_alloc(pcr_len);
memset(pcr_before.ptr, 0x00, pcr_before.len);
@@ -150,7 +150,7 @@ METHOD(pts_component_t, verify, status_t,
return SUCCESS;
}
}
return SUCCESS;
}
@@ -15,7 +15,7 @@
#include "pts/components/pts_comp_evidence.h"
#include <debug.h>
#include <utils/debug.h>
typedef struct private_pts_comp_evidence_t private_pts_comp_evidence_t;
@@ -148,7 +148,7 @@ METHOD(pts_comp_evidence_t, get_pcr_info, bool,
METHOD(pts_comp_evidence_t, set_pcr_info, void,
private_pts_comp_evidence_t *this, chunk_t pcr_before, chunk_t pcr_after)
{
this->has_pcr_info = TRUE;
this->has_pcr_info = TRUE;
this->pcr_before = pcr_before;
this->pcr_after = pcr_after;
@@ -17,7 +17,7 @@
#include "libpts.h"
#include "pts/components/pts_comp_func_name.h"
#include <debug.h>
#include <utils/debug.h>
typedef struct private_pts_comp_func_name_t private_pts_comp_func_name_t;
@@ -16,7 +16,7 @@
#include "pts/components/pts_component_manager.h"
#include <collections/linked_list.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_pts_component_manager_t private_pts_component_manager_t;
typedef struct vendor_entry_t vendor_entry_t;
+1 -1
View File
@@ -15,7 +15,7 @@
#include "pts.h"
#include <debug.h>
#include <utils/debug.h>
#include <crypto/hashers/hasher.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
+1 -1
View File
@@ -15,7 +15,7 @@
#include "pts_creds.h"
#include <debug.h>
#include <utils/debug.h>
#include <credentials/certificates/x509.h>
#include <credentials/sets/mem_cred.h>
+5 -5
View File
@@ -15,7 +15,7 @@
#include "pts_database.h"
#include <debug.h>
#include <utils/debug.h>
#include <crypto/hashers/hasher.h>
@@ -151,7 +151,7 @@ METHOD(pts_database_t, check_file_measurement, status_t,
{
status = VERIFY_ERROR;
}
}
}
e->destroy(e);
return status;
@@ -179,7 +179,7 @@ METHOD(pts_database_t, check_comp_measurement, status_t,
enumerator_t *e;
chunk_t hash;
status_t status = NOT_FOUND;
e = this->db->query(this->db,
"SELECT hash FROM component_hashes "
"WHERE component = ? AND key = ? "
@@ -188,7 +188,7 @@ METHOD(pts_database_t, check_comp_measurement, status_t,
DB_INT, pcr, DB_INT, algo, DB_BLOB);
if (!e)
{
DBG1(DBG_PTS, "no database query enumerator returned");
DBG1(DBG_PTS, "no database query enumerator returned");
return FAILED;
}
@@ -225,7 +225,7 @@ METHOD(pts_database_t, insert_comp_measurement, status_t,
int seq_no, int pcr, pts_meas_algorithms_t algo)
{
int id;
if (this->db->execute(this->db, &id,
"INSERT INTO component_hashes "
"(component, key, seq_no, pcr, algo, hash) "
+2 -2
View File
@@ -15,7 +15,7 @@
#include "pts_dh_group.h"
#include <debug.h>
#include <utils/debug.h>
/**
* Described in header.
@@ -27,7 +27,7 @@ bool pts_dh_group_probe(pts_dh_group_t *dh_groups)
const char *plugin_name;
char format1[] = " %s PTS DH group %N[%s] available";
char format2[] = " %s PTS DH group %N not available";
*dh_groups = PTS_DH_GROUP_NONE;
enumerator = lib->crypto->create_dh_enumerator(lib->crypto);
+1 -1
View File
@@ -16,7 +16,7 @@
#include "pts_file_meas.h"
#include <collections/linked_list.h>
#include <debug.h>
#include <utils/debug.h>
#include <sys/stat.h>
#include <libgen.h>
+1 -1
View File
@@ -16,7 +16,7 @@
#include "pts_file_meta.h"
#include <collections/linked_list.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_pts_file_meta_t private_pts_file_meta_t;
+2 -2
View File
@@ -15,7 +15,7 @@
#include "pts_meas_algo.h"
#include <debug.h>
#include <utils/debug.h>
ENUM_BEGIN(pts_meas_algorithm_names, PTS_MEAS_ALGO_NONE, PTS_MEAS_ALGO_NONE,
"None");
@@ -43,7 +43,7 @@ bool pts_meas_algo_probe(pts_meas_algorithms_t *algorithms)
const char *plugin_name;
char format1[] = " %s PTS measurement algorithm %N[%s] available";
char format2[] = " %s PTS measurement algorithm %N not available";
*algorithms = 0;
enumerator = lib->crypto->create_hasher_enumerator(lib->crypto);
+1 -1
View File
@@ -15,7 +15,7 @@
#include "pts_pcr.h"
#include <debug.h>
#include <utils/debug.h>
#include <stdarg.h>
+3 -3
View File
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_tcg_pts_attr_aik_t private_tcg_pts_attr_aik_t;
@@ -57,7 +57,7 @@ struct private_tcg_pts_attr_aik_t {
* Attribute value
*/
chunk_t value;
/**
* Noskip flag
*/
@@ -135,7 +135,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
u_int8_t flags;
certificate_type_t type;
chunk_t aik_blob;
if (this->value.len < PTS_AIK_SIZE)
{
DBG1(DBG_TNC, "insufficient data for Attestation Identity Key");
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_tcg_pts_attr_dh_nonce_finish_t
private_tcg_pts_attr_dh_nonce_finish_t;
@@ -36,7 +36,7 @@ typedef struct private_tcg_pts_attr_dh_nonce_finish_t
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | D-H Initiator Nonce ... |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
*
*/
#define PTS_DH_NONCE_FINISH_SIZE 12
@@ -66,7 +66,7 @@ struct private_tcg_pts_attr_dh_nonce_finish_t {
* Noskip flag
*/
bool noskip_flag;
/**
* Selected Hashing Algorithm
*/
@@ -127,7 +127,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer->write_uint16(writer, this->hash_algo);
writer->write_data (writer, this->initiator_value);
writer->write_data (writer, this->initiator_nonce);
this->value = chunk_clone(writer->get_buf(writer));
writer->destroy(writer);
}
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_tcg_pts_attr_dh_nonce_params_req_t
private_tcg_pts_attr_dh_nonce_params_req_t;
@@ -32,7 +32,7 @@ typedef struct private_tcg_pts_attr_dh_nonce_params_req_t
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Reserved | Min. Nonce Len | D-H Group Set |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
*
*/
#define PTS_DH_NONCE_PARAMS_REQ_SIZE 4
@@ -62,7 +62,7 @@ struct private_tcg_pts_attr_dh_nonce_params_req_t {
* Noskip flag
*/
bool noskip_flag;
/**
* Minimum acceptable length of nonce
*/
@@ -116,7 +116,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer->write_uint8 (writer, PTS_DH_NONCE_PARAMS_REQ_RESERVED);
writer->write_uint8 (writer, this->min_nonce_len);
writer->write_uint16(writer, this->dh_groups);
this->value = chunk_clone(writer->get_buf(writer));
writer->destroy(writer);
}
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_tcg_pts_attr_dh_nonce_params_resp_t
private_tcg_pts_attr_dh_nonce_params_resp_t;
@@ -38,7 +38,7 @@ typedef struct private_tcg_pts_attr_dh_nonce_params_resp_t
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | D-H Responder Public Value ... |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
*
*/
#define PTS_DH_NONCE_PARAMS_RESP_SIZE 16
@@ -68,7 +68,7 @@ struct private_tcg_pts_attr_dh_nonce_params_resp_t {
* Noskip flag
*/
bool noskip_flag;
/**
* Selected Diffie Hellman group
*/
@@ -135,7 +135,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer->write_uint16(writer, this->hash_algo_set);
writer->write_data (writer, this->responder_nonce);
writer->write_data (writer, this->responder_value);
this->value = chunk_clone(writer->get_buf(writer));
writer->destroy(writer);
}
+1 -1
View File
@@ -19,7 +19,7 @@
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <collections/linked_list.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_tcg_pts_attr_file_meas_t private_tcg_pts_attr_file_meas_t;
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_tcg_pts_attr_gen_attest_evid_t
private_tcg_pts_attr_gen_attest_evid_t;
@@ -33,7 +33,7 @@ typedef struct private_tcg_pts_attr_gen_attest_evid_t
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Reserved |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
*
*/
#define PTS_GEN_ATTEST_EVID_SIZE 4
@@ -115,7 +115,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
{
bio_reader_t *reader;
u_int32_t reserved;
if (this->value.len < PTS_GEN_ATTEST_EVID_SIZE)
{
DBG1(DBG_TNC, "insufficient data for Generate Attestation Evidence");
+2 -2
View File
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_tcg_pts_attr_get_aik_t private_tcg_pts_attr_get_aik_t;
@@ -112,7 +112,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
{
bio_reader_t *reader;
u_int32_t reserved;
if (this->value.len < PTS_GET_AIK_SIZE)
{
DBG1(DBG_TNC, "insufficient data for Get AIK");
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_tcg_pts_attr_get_tpm_version_info_t
private_tcg_pts_attr_get_tpm_version_info_t;
@@ -33,7 +33,7 @@ typedef struct private_tcg_pts_attr_get_tpm_version_info_t
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Reserved |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
*
*/
#define PTS_GET_TPM_VER_INFO_SIZE 4
@@ -115,7 +115,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
{
bio_reader_t *reader;
u_int32_t reserved;
if (this->value.len < PTS_GET_TPM_VER_INFO_SIZE)
{
DBG1(DBG_TNC, "insufficient data for Get TPM Version Information");
+4 -4
View File
@@ -18,12 +18,12 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_tcg_pts_attr_meas_algo_t private_tcg_pts_attr_meas_algo_t;
/**
* PTS Measurement Algorithm
* PTS Measurement Algorithm
* see section 3.9.1 of PTS Protocol: Binding to TNC IF-M Specification
*
* 1 2 3
@@ -31,7 +31,7 @@ typedef struct private_tcg_pts_attr_meas_algo_t private_tcg_pts_attr_meas_algo_t
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Reserved | Hash Algorithm Set |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
*
*/
#define PTS_MEAS_ALGO_SIZE 4
@@ -61,7 +61,7 @@ struct private_tcg_pts_attr_meas_algo_t {
* Noskip flag
*/
bool noskip_flag;
/**
* Set of algorithms
*/
+4 -4
View File
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_tcg_pts_attr_proto_caps_t private_tcg_pts_attr_proto_caps_t;
@@ -31,7 +31,7 @@ typedef struct private_tcg_pts_attr_proto_caps_t private_tcg_pts_attr_proto_caps
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Reserved |C|V|D|T|X|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
*
*/
#define PTS_PROTO_CAPS_SIZE 4
@@ -61,7 +61,7 @@ struct private_tcg_pts_attr_proto_caps_t {
* Noskip flag
*/
bool noskip_flag;
/**
* Set of flags
*/
@@ -109,7 +109,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer = bio_writer_create(PTS_PROTO_CAPS_SIZE);
writer->write_uint16(writer, PTS_PROTO_CAPS_RESERVED);
writer->write_uint16(writer, this->flags);
this->value = chunk_clone(writer->get_buf(writer));
writer->destroy(writer);
}
+8 -8
View File
@@ -18,14 +18,14 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_tcg_pts_attr_req_file_meas_t private_tcg_pts_attr_req_file_meas_t;
/**
* Request File Measurement
* see section 3.19.1 of PTS Protocol: Binding to TNC IF-M Specification
*
*
* 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -62,12 +62,12 @@ struct private_tcg_pts_attr_req_file_meas_t {
* Attribute value
*/
chunk_t value;
/**
* Noskip flag
*/
bool noskip_flag;
/**
* Directory Contents flag
*/
@@ -77,12 +77,12 @@ struct private_tcg_pts_attr_req_file_meas_t {
* Request ID
*/
u_int16_t request_id;
/**
* UTF8 Encoding of Delimiter Character
*/
u_int32_t delimiter;
/**
* Fully Qualified File Pathname
*/
@@ -124,7 +124,7 @@ METHOD(pa_tnc_attr_t, build, void,
u_int8_t flags = PTS_REQ_FILE_MEAS_NO_FLAGS;
chunk_t pathname;
bio_writer_t *writer;
if (this->value.ptr)
{
return;
@@ -152,7 +152,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
u_int8_t flags;
u_int8_t reserved;
chunk_t pathname;
if (this->value.len < PTS_REQ_FILE_MEAS_SIZE)
{
DBG1(DBG_TNC, "insufficient data for Request File Measurement");
+10 -10
View File
@@ -18,14 +18,14 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_tcg_pts_attr_req_file_meta_t private_tcg_pts_attr_req_file_meta_t;
/**
* Request File Metadata
* see section 3.17.1 of PTS Protocol: Binding to TNC IF-M Specification
*
*
* 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -60,22 +60,22 @@ struct private_tcg_pts_attr_req_file_meta_t {
* Attribute value
*/
chunk_t value;
/**
* Noskip flag
*/
bool noskip_flag;
/**
* Directory Contents flag
*/
bool directory_flag;
/**
* UTF8 Encoding of Delimiter Character
*/
u_int8_t delimiter;
/**
* Fully Qualified File Pathname
*/
@@ -117,7 +117,7 @@ METHOD(pa_tnc_attr_t, build, void,
u_int8_t flags = PTS_REQ_FILE_META_NO_FLAGS;
chunk_t pathname;
bio_writer_t *writer;
if (this->value.ptr)
{
return;
@@ -132,7 +132,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer->write_uint8 (writer, flags);
writer->write_uint8 (writer, this->delimiter);
writer->write_uint16(writer, PTS_REQ_FILE_META_RESERVED);
writer->write_data (writer, pathname);
this->value = chunk_clone(writer->get_buf(writer));
writer->destroy(writer);
@@ -145,7 +145,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
u_int8_t flags;
u_int16_t reserved;
chunk_t pathname;
if (this->value.len < PTS_REQ_FILE_META_SIZE)
{
DBG1(DBG_TNC, "insufficient data for Request File Metadata");
@@ -157,7 +157,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
reader->read_uint8 (reader, &flags);
reader->read_uint8 (reader, &this->delimiter);
reader->read_uint16(reader, &reserved);
reader->read_data (reader, reader->remaining(reader), &pathname);
this->directory_flag = (flags & DIRECTORY_CONTENTS_FLAG) !=
@@ -19,7 +19,7 @@
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <collections/linked_list.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_tcg_pts_attr_req_func_comp_evid_t private_tcg_pts_attr_req_func_comp_evid_t;
+17 -17
View File
@@ -18,16 +18,16 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
#include <time.h>
typedef struct private_tcg_pts_attr_simple_comp_evid_t private_tcg_pts_attr_simple_comp_evid_t;
/**
* Simple Component Evidence
* Simple Component Evidence
* see section 3.15.1 of PTS Protocol: Binding to TNC IF-M Specification
*
*
* 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -66,7 +66,7 @@ typedef struct private_tcg_pts_attr_simple_comp_evid_t private_tcg_pts_attr_simp
*/
/**
* Specific Functional Component -> Component Functional Name Structure
* Specific Functional Component -> Component Functional Name Structure
* see section 5.1 of PTS Protocol: Binding to TNC IF-M Specification
*
* 1 2 3
@@ -108,12 +108,12 @@ struct private_tcg_pts_attr_simple_comp_evid_t {
* Attribute value
*/
chunk_t value;
/**
* Noskip flag
*/
bool noskip_flag;
/**
* PTS Component Evidence
*/
@@ -184,7 +184,7 @@ METHOD(pa_tnc_attr_t, build, void,
pts_comp_evid_validation_t validation;
time_t measurement_time;
chunk_t measurement, utc_time, pcr_before, pcr_after;
if (this->value.ptr)
{
return;
@@ -200,7 +200,7 @@ METHOD(pa_tnc_attr_t, build, void,
&pcr_before, &pcr_after);
validation = this->evidence->get_validation(this->evidence,
&policy_uri);
/* Determine the flags to set*/
flags = validation;
if (has_pcr_info)
@@ -208,7 +208,7 @@ METHOD(pa_tnc_attr_t, build, void,
flags |= PTS_SIMPLE_COMP_EVID_FLAG_PCR;
}
utc_time = chunk_create(utc_time_buf, PTS_SIMPLE_COMP_EVID_MEAS_TIME_SIZE);
utc_time = chunk_create(utc_time_buf, PTS_SIMPLE_COMP_EVID_MEAS_TIME_SIZE);
measurement_time_to_utc(measurement_time, &utc_time);
writer = bio_writer_create(PTS_SIMPLE_COMP_EVID_SIZE);
@@ -224,7 +224,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer->write_uint8 (writer, transform);
writer->write_uint8 (writer, PTS_SIMPLE_COMP_EVID_RESERVED);
writer->write_data (writer, utc_time);
/* Optional fields */
if (validation == PTS_COMP_EVID_VALIDATION_FAILED ||
validation == PTS_COMP_EVID_VALIDATION_PASSED)
@@ -241,7 +241,7 @@ METHOD(pa_tnc_attr_t, build, void,
}
writer->write_data(writer, measurement);
this->value = chunk_clone(writer->get_buf(writer));
writer->destroy(writer);
}
@@ -250,7 +250,7 @@ static const int days[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 33
static const int tm_leap_1970 = 477;
/**
* Convert Simple Component Evidence UTS string format to time_t
* Convert Simple Component Evidence UTS string format to time_t
*/
bool measurement_time_from_utc(time_t *measurement_time, chunk_t utc_time)
{
@@ -314,7 +314,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
return FAILED;
}
reader = bio_reader_create(this->value);
reader->read_uint8 (reader, &flags);
reader->read_uint24(reader, &depth);
reader->read_uint24(reader, &vendor_id);
@@ -364,7 +364,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
}
has_validation = TRUE;
}
/* Are optional PCR value fields included? */
if (flags & PTS_SIMPLE_COMP_EVID_FLAG_PCR)
{
@@ -389,11 +389,11 @@ METHOD(pa_tnc_attr_t, process, status_t,
has_pcr_info = TRUE;
}
/* Measurement field comes at the very end */
/* Measurement field comes at the very end */
reader->read_data(reader,reader->remaining(reader), &measurement);
reader->destroy(reader);
/* Create Component Functional Name object */
/* Create Component Functional Name object */
name = pts_comp_func_name_create(vendor_id, comp_name, qualifier);
/* Create Component Evidence object */
@@ -457,7 +457,7 @@ METHOD(tcg_pts_attr_simple_comp_evid_t, get_comp_evidence, pts_comp_evidence_t*,
pa_tnc_attr_t *tcg_pts_attr_simple_comp_evid_create(pts_comp_evidence_t *evid)
{
private_tcg_pts_attr_simple_comp_evid_t *this;
INIT(this,
.public = {
.pa_tnc_attribute = {
+17 -17
View File
@@ -19,14 +19,14 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_tcg_pts_attr_simple_evid_final_t private_tcg_pts_attr_simple_evid_final_t;
/**
* Simple Evidence Final
* see section 3.15.2 of PTS Protocol: Binding to TNC IF-M Specification
*
*
* 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -66,7 +66,7 @@ struct private_tcg_pts_attr_simple_evid_final_t {
* Attribute value
*/
chunk_t value;
/**
* Noskip flag
*/
@@ -81,22 +81,22 @@ struct private_tcg_pts_attr_simple_evid_final_t {
* Optional Composite Hash Algorithm
*/
pts_meas_algorithms_t comp_hash_algorithm;
/**
* Optional TPM PCR Composite
*/
chunk_t pcr_comp;
/**
* Optional TPM Quote Signature
*/
chunk_t tpm_quote_sig;
/**
* Is Evidence Signature included?
*/
bool has_evid_sig;
/**
* Optional Evidence Signature
*/
@@ -157,7 +157,7 @@ METHOD(pa_tnc_attr_t, build, void,
{
bio_writer_t *writer;
u_int8_t flags;
if (this->value.ptr)
{
return;
@@ -172,7 +172,7 @@ METHOD(pa_tnc_attr_t, build, void,
writer = bio_writer_create(PTS_SIMPLE_EVID_FINAL_SIZE);
writer->write_uint8 (writer, flags);
writer->write_uint8 (writer, PTS_SIMPLE_EVID_FINAL_RESERVED);
/** Optional Composite Hash Algorithm field is always present
* Field has value of all zeroes if not used.
* Implemented adhering the suggestion of Paul Sangster 28.Oct.2011
@@ -193,7 +193,7 @@ METHOD(pa_tnc_attr_t, build, void,
{
writer->write_data (writer, this->evid_sig);
}
this->value = chunk_clone(writer->get_buf(writer));
writer->destroy(writer);
}
@@ -206,7 +206,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
u_int16_t algorithm;
u_int32_t pcr_comp_len, tpm_quote_sig_len, evid_sig_len;
status_t status = FAILED;
if (this->value.len < PTS_SIMPLE_EVID_FINAL_SIZE)
{
DBG1(DBG_TNC, "insufficient data for Simple Evidence Final");
@@ -214,7 +214,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
return FAILED;
}
reader = bio_reader_create(this->value);
reader->read_uint8(reader, &flags);
reader->read_uint8(reader, &reserved);
@@ -226,10 +226,10 @@ METHOD(pa_tnc_attr_t, process, status_t,
* Field has value of all zeroes if not used.
* Implemented adhering the suggestion of Paul Sangster 28.Oct.2011
*/
reader->read_uint16(reader, &algorithm);
this->comp_hash_algorithm = algorithm;
/* Optional Composite Hash Algorithm and TPM PCR Composite fields */
if (this->flags != PTS_SIMPLE_EVID_FINAL_NO)
{
@@ -246,7 +246,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
goto end;
}
this->pcr_comp = chunk_clone(this->pcr_comp);
if (!reader->read_uint32(reader, &tpm_quote_sig_len))
{
DBG1(DBG_TNC, "insufficient data for PTS Simple Evidence Final "
@@ -261,7 +261,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
}
this->tpm_quote_sig = chunk_clone(this->tpm_quote_sig);
}
/* Optional Evidence Signature field */
if (this->has_evid_sig)
{
@@ -269,7 +269,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
reader->read_data(reader, evid_sig_len, &this->evid_sig);
this->evid_sig = chunk_clone(this->evid_sig);
}
reader->destroy(reader);
return SUCCESS;
@@ -18,7 +18,7 @@
#include <pa_tnc/pa_tnc_msg.h>
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_tcg_pts_attr_tpm_version_info_t private_tcg_pts_attr_tpm_version_info_t;
@@ -62,7 +62,7 @@ struct private_tcg_pts_attr_tpm_version_info_t {
* Noskip flag
*/
bool noskip_flag;
/**
* TPM Version Information
*/
@@ -118,7 +118,7 @@ METHOD(pa_tnc_attr_t, process, status_t,
private_tcg_pts_attr_tpm_version_info_t *this, u_int32_t *offset)
{
bio_reader_t *reader;
if (this->value.len < PTS_TPM_VER_INFO_SIZE)
{
DBG1(DBG_TNC, "insufficient data for TPM Version Information");
+1 -1
View File
@@ -19,7 +19,7 @@
#include <bio/bio_writer.h>
#include <bio/bio_reader.h>
#include <collections/linked_list.h>
#include <debug.h>
#include <utils/debug.h>
typedef struct private_tcg_pts_attr_file_meta_t private_tcg_pts_attr_file_meta_t;