refactored simple component evidence

This commit is contained in:
Andreas Steffen
2011-11-28 21:22:01 +01:00
parent 21b4efc097
commit cb3ecd5aa5
15 changed files with 851 additions and 839 deletions
+1
View File
@@ -20,6 +20,7 @@ libpts_la_SOURCES = \
pts/pts_meas_algo.h pts/pts_meas_algo.c \
pts/components/pts_component.h \
pts/components/pts_component_manager.h pts/components/pts_component_manager.c \
pts/components/pts_comp_evidence.h pts/components/pts_comp_evidence.c \
pts/components/pts_comp_func_name.h pts/components/pts_comp_func_name.c \
pts/components/ita/ita_comp_func_name.h pts/components/ita/ita_comp_func_name.c \
pts/components/ita/ita_comp_tboot.h pts/components/ita/ita_comp_tboot.c \
+101 -10
View File
@@ -17,7 +17,6 @@
#include "ita_comp_tboot.h"
#include "ita_comp_func_name.h"
#include "pts/pts_func_comp_evid_req.h"
#include "pts/components/pts_component.h"
#include <debug.h>
@@ -32,7 +31,7 @@ typedef struct pts_ita_comp_tboot_t pts_ita_comp_tboot_t;
struct pts_ita_comp_tboot_t {
/**
* Public pts_component_manager_t interface.
* Public pts_component_t interface.
*/
pts_component_t public;
@@ -40,6 +39,17 @@ struct pts_ita_comp_tboot_t {
* Component Functional Name
*/
pts_comp_func_name_t *name;
/**
* Extended PCR last handled
*/
u_int32_t extended_pcr;
/**
* Time of TBOOT measurement
*/
time_t measurement_time;
};
METHOD(pts_component_t, get_comp_func_name, pts_comp_func_name_t*,
@@ -54,18 +64,99 @@ METHOD(pts_component_t, get_evidence_flags, u_int8_t,
return PTS_REQ_FUNC_COMP_FLAG_PCR;
}
METHOD(pts_component_t, measure, bool,
pts_ita_comp_tboot_t *this)
METHOD(pts_component_t, measure, status_t,
pts_ita_comp_tboot_t *this, pts_t *pts, pts_comp_evidence_t **evidence)
{
/* TODO measure the tboot functional component */
return FALSE;
pts_comp_evidence_t *evid;
char *meas_hex, *pcr_before_hex, *pcr_after_hex;
chunk_t measurement, pcr_before, pcr_after;
switch (this->extended_pcr)
{
case 0:
/* dummy data since currently the TBOOT log is not retrieved */
time(&this->measurement_time);
meas_hex = lib->settings->get_str(lib->settings,
"libimcv.plugins.imc-attestation.pcr17_meas", NULL);
pcr_before_hex = lib->settings->get_str(lib->settings,
"libimcv.plugins.imc-attestation.pcr17_before", NULL);
pcr_after_hex = lib->settings->get_str(lib->settings,
"libimcv.plugins.imc-attestation.pcr17_after", NULL);
this->extended_pcr = PCR_TBOOT_POLICY;
break;
case PCR_TBOOT_POLICY:
/* dummy data since currently the TBOOT log is not retrieved */
meas_hex = lib->settings->get_str(lib->settings,
"libimcv.plugins.imc-attestation.pcr18_meas", NULL);
pcr_before_hex = lib->settings->get_str(lib->settings,
"libimcv.plugins.imc-attestation.pcr18_before", NULL);
pcr_after_hex = lib->settings->get_str(lib->settings,
"libimcv.plugins.imc-attestation.pcr18_after", NULL);
this->extended_pcr = PCR_TBOOT_MLE;
break;
default:
return FAILED;
}
measurement = chunk_from_hex(
chunk_create(meas_hex, strlen(meas_hex)), NULL);
pcr_before = chunk_from_hex(
chunk_create(pcr_before_hex, strlen(pcr_before_hex)), NULL);
pcr_after = chunk_from_hex(
chunk_create(pcr_after_hex, strlen(pcr_after_hex)), NULL);
evid = *evidence = pts_comp_evidence_create(this->name, 0,
this->extended_pcr,
PTS_MEAS_ALGO_SHA1, PTS_PCR_TRANSFORM_NO,
this->measurement_time, measurement);
evid->set_pcr_info(evid, pcr_before, pcr_after);
return (this->extended_pcr == PCR_TBOOT_MLE) ? SUCCESS : NEED_MORE;
}
METHOD(pts_component_t, verify, bool,
pts_ita_comp_tboot_t *this)
METHOD(pts_component_t, verify, status_t,
pts_ita_comp_tboot_t *this, pts_t *pts, pts_database_t *pts_db,
pts_comp_evidence_t *evidence)
{
/* TODO verify the measurement of the tboot functional component */
return FALSE;
bool has_pcr_info;
u_int32_t extended_pcr;
pts_meas_algorithms_t algo;
pts_pcr_transform_t transform;
time_t measurement_time;
chunk_t measurement, pcr_before, pcr_after;
pcr_entry_t *entry;
switch (this->extended_pcr)
{
case 0:
this->extended_pcr = PCR_TBOOT_POLICY;
break;
case PCR_TBOOT_POLICY:
this->extended_pcr = PCR_TBOOT_MLE;
break;
default:
return FAILED;
}
measurement = evidence->get_measurement(evidence, &extended_pcr,
&algo, &transform, &measurement_time);
if (extended_pcr != this->extended_pcr)
{
return FAILED;
}
/* TODO check measurement in database */
has_pcr_info = evidence->get_pcr_info(evidence, &pcr_before, &pcr_after);
if (has_pcr_info)
{
entry = malloc_thing(pcr_entry_t);
entry->pcr_number = extended_pcr;
memcpy(entry->pcr_value, pcr_after.ptr, PCR_LEN);
pts->add_pcr_entry(pts, entry);
}
return (this->extended_pcr == PCR_TBOOT_MLE) ? SUCCESS : NEED_MORE;
}
METHOD(pts_component_t, destroy, void,
+60 -10
View File
@@ -17,7 +17,6 @@
#include "ita_comp_tgrub.h"
#include "ita_comp_func_name.h"
#include "pts/pts_func_comp_evid_req.h"
#include "pts/components/pts_component.h"
#include <debug.h>
@@ -32,7 +31,7 @@ typedef struct pts_ita_comp_tgrub_t pts_ita_comp_tgrub_t;
struct pts_ita_comp_tgrub_t {
/**
* Public pts_component_manager_t interface.
* Public pts_component_t interface.
*/
pts_component_t public;
@@ -54,18 +53,69 @@ METHOD(pts_component_t, get_evidence_flags, u_int8_t,
return PTS_REQ_FUNC_COMP_FLAG_PCR;
}
METHOD(pts_component_t, measure, bool,
pts_ita_comp_tgrub_t *this)
METHOD(pts_component_t, measure, status_t,
pts_ita_comp_tgrub_t *this, pts_t *pts, pts_comp_evidence_t **evidence)
{
/* TODO measure the tgrub functional component */
return FALSE;
pts_comp_evidence_t *evid;
u_int32_t extended_pcr;
time_t measurement_time;
chunk_t measurement, pcr_before, pcr_after;
/* Provisional implementation for TGRUB */
extended_pcr = PCR_DEBUG;
time(&measurement_time);
if (!pts->read_pcr(pts, extended_pcr, &pcr_after))
{
DBG1(DBG_PTS, "error occured while reading PCR: %d", extended_pcr);
return FAILED;
}
measurement = chunk_alloc(HASH_SIZE_SHA1);
memset(measurement.ptr, 0x00, measurement.len);
pcr_before = chunk_alloc(PCR_LEN);
memset(pcr_before.ptr, 0x00, pcr_before.len);
evid = *evidence = pts_comp_evidence_create(this->name, 0, extended_pcr,
PTS_MEAS_ALGO_SHA1, PTS_PCR_TRANSFORM_NO,
measurement_time, measurement);
evid->set_pcr_info(evid, pcr_before, pcr_after);
return SUCCESS;
}
METHOD(pts_component_t, verify, bool,
pts_ita_comp_tgrub_t *this)
METHOD(pts_component_t, verify, status_t,
pts_ita_comp_tgrub_t *this, pts_t *pts, pts_database_t *pts_db,
pts_comp_evidence_t *evidence)
{
/* TODO verify the measurement of the tgrub functional component */
return FALSE;
bool has_pcr_info;
u_int32_t extended_pcr;
pts_meas_algorithms_t algo;
pts_pcr_transform_t transform;
time_t measurement_time;
chunk_t measurement, pcr_before, pcr_after;
pcr_entry_t *entry;
measurement = evidence->get_measurement(evidence, &extended_pcr,
&algo, &transform, &measurement_time);
if (extended_pcr != PCR_DEBUG)
{
return FAILED;
}
/* TODO check measurement in database */
has_pcr_info = evidence->get_pcr_info(evidence, &pcr_before, &pcr_after);
if (has_pcr_info)
{
entry = malloc_thing(pcr_entry_t);
entry->pcr_number = extended_pcr;
memcpy(entry->pcr_value, pcr_after.ptr, PCR_LEN);
pts->add_pcr_entry(pts, entry);
}
return SUCCESS;
}
METHOD(pts_component_t, destroy, void,
@@ -0,0 +1,225 @@
/*
* Copyright (C) 2011 Sansar Choinyambuu, Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
#include "pts/components/pts_comp_evidence.h"
#include <debug.h>
typedef struct private_pts_comp_evidence_t private_pts_comp_evidence_t;
/**
* Private data of a pts_comp_evidence_t object.
*/
struct private_pts_comp_evidence_t {
/**
* Public pts_comp_evidence_t interface.
*/
pts_comp_evidence_t public;
/**
* Component Functional Name
*/
pts_comp_func_name_t *name;
/**
* Sub-Component Depth
*/
u_int32_t depth;
/**
* Measurement Time
*/
time_t measurement_time;
/**
* Measurement Time
*/
chunk_t measurement;
/**
* Measurement Hash Algorithm
*/
pts_meas_algorithms_t hash_algorithm;
/**
* Is PCR Information included?
*/
bool has_pcr_info;
/**
* PCR the measurement was extended into
*/
u_int32_t extended_pcr;
/**
* PCR value before extension
*/
chunk_t pcr_before;
/**
* PCR value after extension
*/
chunk_t pcr_after;
/**
* Transformation used for extending measurement into PCR
*/
pts_pcr_transform_t transform;
/**
* Component Validation Result
*/
pts_comp_evid_validation_t validation;
/**
* Verification Policy URI
*/
chunk_t policy_uri;
};
METHOD(pts_comp_evidence_t, get_comp_func_name, pts_comp_func_name_t*,
private_pts_comp_evidence_t *this, u_int32_t *depth)
{
if (depth)
{
*depth = this->depth;
}
return this->name;
}
METHOD(pts_comp_evidence_t, get_extended_pcr, u_int32_t,
private_pts_comp_evidence_t *this)
{
return this->extended_pcr;
}
METHOD(pts_comp_evidence_t, get_measurement, chunk_t,
private_pts_comp_evidence_t *this, u_int32_t *extended_pcr,
pts_meas_algorithms_t *algo, pts_pcr_transform_t *transform,
time_t *measurement_time)
{
if (extended_pcr)
{
*extended_pcr = this->extended_pcr;
}
if (algo)
{
*algo = this->hash_algorithm;
}
if (transform)
{
*transform = this->transform;
}
if (measurement_time)
{
*measurement_time = this->measurement_time;
}
return this->measurement;
}
METHOD(pts_comp_evidence_t, get_pcr_info, bool,
private_pts_comp_evidence_t *this, chunk_t *pcr_before, chunk_t *pcr_after)
{
if (pcr_before)
{
*pcr_before = this->pcr_before;
}
if (pcr_after)
{
*pcr_after = this->pcr_after;
}
return this->has_pcr_info;
}
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->pcr_before = pcr_before;
this->pcr_after = pcr_after;
DBG2(DBG_PTS, "PCR %2d before value : %#B", this->extended_pcr, &pcr_before);
DBG2(DBG_PTS, "PCR %2d after value : %#B", this->extended_pcr, &pcr_after);
}
METHOD(pts_comp_evidence_t, get_validation, pts_comp_evid_validation_t,
private_pts_comp_evidence_t *this, chunk_t *uri)
{
if (uri)
{
*uri = this->policy_uri;
}
return this->validation;
}
METHOD(pts_comp_evidence_t, set_validation, void,
private_pts_comp_evidence_t *this, pts_comp_evid_validation_t validation,
chunk_t uri)
{
this->validation = validation;
this->policy_uri = chunk_clone(uri);
}
METHOD(pts_comp_evidence_t, destroy, void,
private_pts_comp_evidence_t *this)
{
this->name->destroy(this->name);
free(this->measurement.ptr);
free(this->pcr_before.ptr);
free(this->pcr_after.ptr);
free(this->policy_uri.ptr);
free(this);
}
/**
* See header
*/
pts_comp_evidence_t *pts_comp_evidence_create(pts_comp_func_name_t *name,
u_int32_t depth,
u_int32_t extended_pcr,
pts_meas_algorithms_t algo,
pts_pcr_transform_t transform,
time_t measurement_time,
chunk_t measurement)
{
private_pts_comp_evidence_t *this;
INIT(this,
.public = {
.get_comp_func_name = _get_comp_func_name,
.get_extended_pcr = _get_extended_pcr,
.get_measurement = _get_measurement,
.get_pcr_info = _get_pcr_info,
.set_pcr_info = _set_pcr_info,
.get_validation = _get_validation,
.set_validation = _set_validation,
.destroy = _destroy,
},
.name = name->clone(name),
.depth = depth,
.extended_pcr = extended_pcr,
.hash_algorithm = algo,
.transform = transform,
.measurement_time = measurement_time,
.measurement = measurement,
);
name->log(name, "");
DBG2(DBG_PTS, "PCR %2d extended with: %#B", extended_pcr, &measurement);
return &this->public;
}
@@ -0,0 +1,160 @@
/*
* Copyright (C) 2011 Sansar Choinyambuu, Andreas Steffen
* HSR Hochschule fuer Technik Rapperswil
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
/**
* @defgroup pts_comp_evidence pts_comp_evidence
* @{ @ingroup pts
*/
#ifndef PTS_COMP_EVIDENCE_H_
#define PTS_COMP_EVIDENCE_H_
typedef struct pts_comp_evidence_t pts_comp_evidence_t;
typedef enum pts_pcr_transform_t pts_pcr_transform_t;
typedef enum pts_comp_evid_validation_t pts_comp_evid_validation_t;
#include "pts/pts_meas_algo.h"
#include "pts/components/pts_comp_func_name.h"
#include <library.h>
/**
* PTS PCR Transformations
*/
enum pts_pcr_transform_t {
/** No Transformation */
PTS_PCR_TRANSFORM_NO = 0,
/** Hash Value matched PCR size */
PTS_PCR_TRANSFORM_MATCH = 1,
/** Hash value shorter than PCR size */
PTS_PCR_TRANSFORM_SHORT = 2,
/** Hash value longer than PCR size */
PTS_PCR_TRANSFORM_LONG = 3,
};
/**
* PTS Component Evidence Validation Result Flags
*/
enum pts_comp_evid_validation_t {
/** No Validation was attempted */
PTS_COMP_EVID_VALIDATION_NONE = 0x00,
/** Attempted validation, unable to verify */
PTS_COMP_EVID_VALIDATION_UNABLE = 0x20,
/** Attempted validation, verification failed */
PTS_COMP_EVID_VALIDATION_FAILED = 0x40,
/** Attempted validation, verification passed */
PTS_COMP_EVID_VALIDATION_PASSED = 0x60,
};
/**
* PTS Functional Component Interface
*/
struct pts_comp_evidence_t {
/**
* Gets the Component Functional Name and Sub-Component Depth
*
* @param depth Sub-Component Depth
* @result Component Functional Name
*/
pts_comp_func_name_t* (*get_comp_func_name)(pts_comp_evidence_t *this,
u_int32_t *depth);
/**
* Gets the PCR the measurement was extended into
*
* @result PCR the measurement was extended into
*/
u_int32_t (*get_extended_pcr)(pts_comp_evidence_t *this);
/**
* Gets the measurement and the algorithms used
*
* @param extended_pcr PCR the measurement was extended into
* @param algo Measurement hash algorithm
* @param transform Transformation used for PCR extension
* @param measurement_time Time the measurement was taken
* @result Measurement hash value
*/
chunk_t (*get_measurement)(pts_comp_evidence_t *this,
u_int32_t *extended_pcr,
pts_meas_algorithms_t *algo,
pts_pcr_transform_t *transform,
time_t *measurement_time);
/**
* Gets the PCR information if available
*
* @param pcr_before PCR value before extension
* @param pcr_after PCR value after extension
* @result TRUE if PCR information is available
*/
bool (*get_pcr_info)(pts_comp_evidence_t *this, chunk_t *pcr_before,
chunk_t *pcr_after);
/**
* Sets PCR information if available
*
* @param pcr_before PCR value before extension
* @param pcr_after PCR value after extension
*/
void (*set_pcr_info)(pts_comp_evidence_t *this, chunk_t pcr_before,
chunk_t pcr_after);
/**
* Gets Validation Result if available
*
* @param uri Verification Policy URI
* @return validation Validation Result
*/
pts_comp_evid_validation_t (*get_validation)(pts_comp_evidence_t *this,
chunk_t *uri);
/**
* Sets Validation Result if available
*
* @param validation Validation Result
* @param uri Verification Policy URI
*/
void (*set_validation)(pts_comp_evidence_t *this,
pts_comp_evid_validation_t validation, chunk_t uri);
/**
* Destroys a pts_comp_evidence_t object.
*/
void (*destroy)(pts_comp_evidence_t *this);
};
/**
* Creates a pts_comp_evidence_t object
*
* @param name Component Functional Name
* @param depth Sub-component depth
* @param extended_pcr PCR the measurement was extended into
* @param algo Measurement hash algorithm
* @param transform Transformation used for PCR extension
* @param measurement_time Time the measurement was taken, 0 if unknown
* @param measurement Measurement hash value
*/
pts_comp_evidence_t* pts_comp_evidence_create(pts_comp_func_name_t *name,
u_int32_t depth,
u_int32_t extended_pcr,
pts_meas_algorithms_t algo,
pts_pcr_transform_t transform,
time_t measurement_time,
chunk_t measurement);
#endif /** PTS_COMP_EVIDENCE_H_ @}*/
+17 -6
View File
@@ -23,7 +23,10 @@
typedef struct pts_component_t pts_component_t;
#include "pts/pts.h"
#include "pts/pts_database.h"
#include "pts/components/pts_comp_func_name.h"
#include "pts/components/pts_comp_evidence.h"
#include <library.h>
@@ -47,18 +50,26 @@ struct pts_component_t {
u_int8_t (*get_evidence_flags)(pts_component_t *this);
/**
* Do measurements on the PTS Functional Component
* Do evidence measurements on the PTS Functional Component
*
* @return TRUE if component measurements are successful
* @param pts PTS interface
* @param evidence returns component evidence measureemt
* @return status return code
*/
bool (*measure)(pts_component_t *this);
status_t (*measure)(pts_component_t *this, pts_t *pts,
pts_comp_evidence_t** evidence);
/**
* Verify the measurements of the PTS Functional Component
* Verify the evidence measurements of the PTS Functional Component
*
* @return TRUE if verification is successful
* @param pts PTS interface
* @param pts_db PTS measurement database
* @param evidence component evidence measurement to be verified
* @return status return code
*/
bool (*verify)(pts_component_t *this);
status_t (*verify)(pts_component_t *this, pts_t *pts,
pts_database_t *pts_db,
pts_comp_evidence_t *evidence);
/**
* Destroys a pts_component_t object.
+159 -308
View File
@@ -20,6 +20,8 @@
#include <bio/bio_reader.h>
#include <debug.h>
#include <time.h>
typedef struct private_tcg_pts_attr_simple_comp_evid_t private_tcg_pts_attr_simple_comp_evid_t;
/**
@@ -29,37 +31,37 @@ typedef struct private_tcg_pts_attr_simple_comp_evid_t private_tcg_pts_attr_simp
* 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
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Flags | Sub-Component Depth |
* | Flags | Sub-Component Depth |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Specific Functional Component |
* | Specific Functional Component |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Specific Functional Component |
* | Specific Functional Component |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Measure. Type | Extended into PCR |
* | Measure. Type | Extended into PCR |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Hash Algorithm | PCR Transform | Reserved |
* | Hash Algorithm | PCR Transform | Reserved |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Measurement Date/Time |
* | Measurement Date/Time |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Measurement Date/Time |
* | Measurement Date/Time |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Measurement Date/Time |
* | Measurement Date/Time |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Measurement Date/Time |
* | Measurement Date/Time |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Measurement Date/Time |
* | Measurement Date/Time |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Optional Policy URI Length | Opt. Verification Policy URI ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ Optional Verification Policy URI ~
* ~ Optional Verification Policy URI ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Optional PCR Length | Optional PCR Before Value ~
* | Optional PCR Length | Optional PCR Before Value ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ Optional PCR Before Value (Variable Length) ~
* ~ Optional PCR Before Value (Variable Length) ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ Optional PCR After Value (Variable Length) ~
* ~ Optional PCR After Value (Variable Length) ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ Component Measurement (Variable Length) ~
* ~ Component Measurement (Variable Length) ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
@@ -70,16 +72,20 @@ typedef struct private_tcg_pts_attr_simple_comp_evid_t private_tcg_pts_attr_simp
* 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
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Component Functional Name Vendor ID |Fam| Qualifier |
* | Component Functional Name Vendor ID |Fam| Qualifier |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Component Functional Name |
* | Component Functional Name |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
*/
#define PTS_SIMPLE_COMP_EVID_SIZE 40
#define PTS_SIMPLE_COMP_EVID_MEASUREMENT_TIME_SIZE 20
#define PTS_SIMPLE_COMP_EVID_MEAS_TIME_SIZE 20
#define PTS_SIMPLE_COMP_EVID_RESERVED 0x00
#define PTS_SIMPLE_COMP_EVID_FAMILY_MASK 0xC0
#define PTS_SIMPLE_COMP_EVID_VALIDATION_MASK 0x60
#define PTS_SIMPLE_COMP_EVID_MEAS_TYPE (1<<7)
#define PTS_SIMPLE_COMP_EVID_FLAG_PCR (1<<7)
/**
* Private data of an tcg_pts_attr_simple_comp_evid_t object.
@@ -112,69 +118,9 @@ struct private_tcg_pts_attr_simple_comp_evid_t {
bool noskip_flag;
/**
* Set of flags for Simple Component Evidence
* PTS Component Evidence
*/
pts_attr_simple_comp_evid_flag_t flags;
/**
* PCR Information included
*/
bool pcr_info_included;
/**
* Sub-component Depth
*/
u_int32_t depth;
/**
* Component Functional Name
*/
pts_comp_func_name_t *name;
/**
* Measurement type
*/
u_int8_t measurement_type;
/**
* Which PCR the functional component is extended into
*/
u_int32_t extended_pcr;
/**
* Hash Algorithm
*/
pts_meas_algorithms_t hash_algorithm;
/**
* Transformation type for PCR
*/
pts_pcr_transform_t transformation;
/**
* Measurement time
*/
chunk_t measurement_time;
/**
* Optional Policy URI
*/
chunk_t policy_uri;
/**
* Optional PCR before value
*/
chunk_t pcr_before;
/**
* Optional PCR after value
*/
chunk_t pcr_after;
/**
* Component Measurement
*/
chunk_t measurement;
pts_comp_evidence_t *evidence;
};
@@ -212,57 +158,81 @@ METHOD(pa_tnc_attr_t, build, void,
private_tcg_pts_attr_simple_comp_evid_t *this)
{
bio_writer_t *writer;
u_int8_t flags = 0;
bool has_pcr_info;
char *utc_time_str, utc_time_buf[25];
u_int8_t flags;
u_int32_t depth, extended_pcr;
pts_comp_func_name_t *name;
pts_meas_algorithms_t hash_algorithm;
pts_pcr_transform_t transform;
pts_comp_evid_validation_t validation;
time_t measurement_time;
chunk_t measurement, utc_time, pcr_before, pcr_after, policy_uri;
/* Extract parameters from comp_evidence_t object */
name = this->evidence->get_comp_func_name(this->evidence,
&depth);
measurement = this->evidence->get_measurement(this->evidence,
&extended_pcr, &hash_algorithm, &transform,
&measurement_time);
has_pcr_info = this->evidence->get_pcr_info(this->evidence,
&pcr_before, &pcr_after);
validation = this->evidence->get_validation(this->evidence,
&policy_uri);
writer = bio_writer_create(PTS_SIMPLE_COMP_EVID_SIZE);
/* Determine the flags to set*/
if (this->pcr_info_included)
flags = validation;
if (has_pcr_info)
{
flags += 128;
flags |= PTS_SIMPLE_COMP_EVID_FLAG_PCR;
}
if (this->flags == PTS_SIMPLE_COMP_EVID_FLAG_NO_VER)
/* Form the UTC measurement time string */
if (measurement_time == UNDEFINED_TIME)
{
flags += 32;
utc_time_str = "0000-00-00T00:00:00Z";
}
else if (this->flags == PTS_SIMPLE_COMP_EVID_FLAG_VER_FAIL)
else
{
flags += 64;
}
else if (this->flags == PTS_SIMPLE_COMP_EVID_FLAG_VER_PASS)
{
flags += 96;
struct tm t;
gmtime_r(&measurement_time, &t);
utc_time_str = utc_time_buf;
sprintf(utc_time_str, "%04d-%.02d-%.02dT%.02d:%.02d:%.02dZ",
t.tm_year + 1900, t.tm_mon + 1, t.tm_mday,
t.tm_hour, t.tm_min, t.tm_sec);
}
utc_time = chunk_create(utc_time_str, PTS_SIMPLE_COMP_EVID_MEAS_TIME_SIZE);
writer = bio_writer_create(PTS_SIMPLE_COMP_EVID_SIZE);
writer->write_uint8 (writer, flags);
writer->write_uint24(writer, this->depth);
writer->write_uint24(writer, this->name->get_vendor_id(this->name));
writer->write_uint8 (writer, this->name->get_qualifier(this->name));
writer->write_uint32(writer, this->name->get_name(this->name));
writer->write_uint8 (writer, (this->measurement_type << 7));
writer->write_uint24(writer, this->extended_pcr);
writer->write_uint16(writer, this->hash_algorithm);
writer->write_uint8 (writer, this->transformation);
writer->write_data (writer, this->measurement_time);
writer->write_uint24(writer, depth);
writer->write_uint24(writer, name->get_vendor_id(name));
writer->write_uint8 (writer, name->get_qualifier(name));
writer->write_uint32(writer, name->get_name(name));
writer->write_uint8 (writer, PTS_SIMPLE_COMP_EVID_MEAS_TYPE);
writer->write_uint24(writer, extended_pcr);
writer->write_uint16(writer, hash_algorithm);
writer->write_uint8 (writer, transform);
writer->write_uint8 (writer, PTS_SIMPLE_COMP_EVID_RESERVED);
writer->write_data (writer, utc_time);
/* Optional fields */
if (this->policy_uri.ptr && this->policy_uri.len > 0)
if (validation == PTS_COMP_EVID_VALIDATION_FAILED ||
validation == PTS_COMP_EVID_VALIDATION_PASSED)
{
writer->write_uint16(writer, this->policy_uri.len);
writer->write_data (writer, this->policy_uri);
writer->write_uint16(writer, policy_uri.len);
writer->write_data (writer, policy_uri);
}
if (this->pcr_before.ptr && this->pcr_after.ptr &&
this->pcr_before.len == this->pcr_after.len &&
this->pcr_before.len > 0 && this->pcr_after.len > 0)
if (has_pcr_info)
{
writer->write_uint16(writer, this->pcr_before.len);
writer->write_data (writer, this->pcr_before);
writer->write_data (writer, this->pcr_after);
writer->write_uint16(writer, pcr_before.len);
writer->write_data (writer, pcr_before);
writer->write_data (writer, pcr_after);
}
if (this->measurement.ptr && this->measurement.len > 0)
{
writer->write_data (writer, this->measurement);
}
writer->write_data(writer, measurement);
this->value = chunk_clone(writer->get_buf(writer));
writer->destroy(writer);
@@ -272,11 +242,15 @@ METHOD(pa_tnc_attr_t, process, status_t,
private_tcg_pts_attr_simple_comp_evid_t *this, u_int32_t *offset)
{
bio_reader_t *reader;
u_int8_t flags, fam_and_qualifier, qualifier;
u_int8_t measurement_type, transformation;
u_int16_t algorithm;
u_int32_t vendor_id, name, measurement_len;
pts_comp_func_name_t *name;
u_int8_t flags, fam_and_qualifier, qualifier, reserved;
u_int8_t measurement_type, transform, validation;
u_int16_t hash_algorithm, len;
u_int32_t depth, vendor_id, comp_name, extended_pcr;
chunk_t measurement, utc_time, policy_uri, pcr_before, pcr_after;
time_t measurement_time;
bool has_pcr_info = FALSE, has_validation = FALSE;
if (this->value.len < PTS_SIMPLE_COMP_EVID_SIZE)
{
DBG1(DBG_TNC, "insufficient data for Simple Component Evidence");
@@ -285,182 +259,96 @@ METHOD(pa_tnc_attr_t, process, status_t,
}
reader = bio_reader_create(this->value);
reader->read_uint8(reader, &flags);
/* Determine the flags to set*/
if ((flags >> 7) & 1)
{
this->pcr_info_included = TRUE;
}
if (!((flags >> 6) & 1) && !((flags >> 5) & 1))
{
this->flags = PTS_SIMPLE_COMP_EVID_FLAG_NO_VALID;
}
else if (!((flags >> 6) & 1) && ((flags >> 5) & 1))
{
this->flags = PTS_SIMPLE_COMP_EVID_FLAG_NO_VER;
}
else if (((flags >> 6) & 1) && !((flags >> 5) & 1))
{
this->flags = PTS_SIMPLE_COMP_EVID_FLAG_VER_FAIL;
}
else if (((flags >> 6) & 1) && ((flags >> 5) & 1))
{
this->flags = PTS_SIMPLE_COMP_EVID_FLAG_VER_PASS;
}
reader->read_uint24(reader, &this->depth);
reader->read_uint8 (reader, &flags);
reader->read_uint24(reader, &depth);
reader->read_uint24(reader, &vendor_id);
reader->read_uint8 (reader, &fam_and_qualifier);
reader->read_uint32(reader, &name);
reader->read_uint32(reader, &comp_name);
reader->read_uint8 (reader, &measurement_type);
reader->read_uint24(reader, &this->extended_pcr);
reader->read_uint16(reader, &algorithm);
reader->read_uint8 (reader, &transformation);
reader->read_data (reader, PTS_SIMPLE_COMP_EVID_MEASUREMENT_TIME_SIZE,
&this->measurement_time);
reader->read_uint24(reader, &extended_pcr);
reader->read_uint16(reader, &hash_algorithm);
reader->read_uint8 (reader, &transform);
reader->read_uint8 (reader, &reserved);
reader->read_data (reader, PTS_SIMPLE_COMP_EVID_MEAS_TIME_SIZE, &utc_time);
qualifier = fam_and_qualifier & (!PTS_SIMPLE_COMP_EVID_FAMILY_MASK);
this->name = pts_comp_func_name_create(vendor_id, name, qualifier);
this->measurement_type = (measurement_type >> 7 ) & 1;
this->hash_algorithm = algorithm;
this->transformation = transformation;
this->measurement_time = chunk_clone(this->measurement_time);
/* Optional Policy URI field is included */
if ((this->flags == PTS_SIMPLE_COMP_EVID_FLAG_VER_FAIL) ||
(this->flags == PTS_SIMPLE_COMP_EVID_FLAG_VER_PASS))
if (measurement_type != PTS_SIMPLE_COMP_EVID_MEAS_TYPE)
{
u_int16_t policy_uri_len;
reader->read_uint16(reader, &policy_uri_len);
reader->read_data(reader, policy_uri_len, &this->policy_uri);
this->policy_uri = chunk_clone(this->policy_uri);
DBG1(DBG_TNC, "unsupported Measurement Type in Simple Component Evidence");
*offset = 12;
reader->destroy(reader);
return FAILED;
}
validation = flags & PTS_SIMPLE_COMP_EVID_VALIDATION_MASK;
qualifier = fam_and_qualifier & ~PTS_SIMPLE_COMP_EVID_FAMILY_MASK;
/* TODO Parse the UTC time string */
measurement_time = 0;
/* Is optional Policy URI field included? */
if (validation == PTS_COMP_EVID_VALIDATION_FAILED ||
validation == PTS_COMP_EVID_VALIDATION_PASSED)
{
reader->read_uint16(reader, &len);
reader->read_data(reader, len, &policy_uri);
has_validation = TRUE;
}
/* Optional PCR value fields are included */
if (this->pcr_info_included)
/* Are optional PCR value fields included? */
if (flags & PTS_SIMPLE_COMP_EVID_FLAG_PCR)
{
u_int16_t pcr_value_len;
reader->read_uint16(reader, &pcr_value_len);
reader->read_data(reader, pcr_value_len, &this->pcr_before);
this->pcr_before = chunk_clone(this->pcr_before);
reader->read_data(reader, pcr_value_len, &this->pcr_after);
this->pcr_after = chunk_clone(this->pcr_after);
reader->read_uint16(reader, &len);
reader->read_data(reader, len, &pcr_before);
reader->read_data(reader, len, &pcr_after);
has_pcr_info = TRUE;
}
measurement_len = reader->remaining(reader);
reader->read_data(reader, measurement_len, &this->measurement);
this->measurement = chunk_clone(this->measurement);
/* Measurement field comes at the very end */
reader->read_data(reader,reader->remaining(reader), &measurement);
reader->destroy(reader);
/* Create Component Functional Name object */
name = pts_comp_func_name_create(vendor_id, comp_name, qualifier);
/* Create Component Evidence object */
measurement = chunk_clone(measurement);
this->evidence = pts_comp_evidence_create(name, depth, extended_pcr,
hash_algorithm, transform,
measurement_time, measurement);
/* Add options */
if (has_validation)
{
policy_uri = chunk_clone(policy_uri);
this->evidence->set_validation(this->evidence, validation, policy_uri);
}
if (has_pcr_info)
{
pcr_before = chunk_clone(pcr_before);
pcr_after = chunk_clone(pcr_after);
this->evidence->set_pcr_info(this->evidence, pcr_before, pcr_after);
}
return SUCCESS;
}
METHOD(pa_tnc_attr_t, destroy, void,
private_tcg_pts_attr_simple_comp_evid_t *this)
{
free(this->value.ptr);
free(this->measurement_time.ptr);
free(this->policy_uri.ptr);
free(this->pcr_before.ptr);
free(this->pcr_after.ptr);
free(this->measurement.ptr);
this->evidence->destroy(this->evidence);
free(this);
}
METHOD(tcg_pts_attr_simple_comp_evid_t, is_pcr_info_included, bool,
METHOD(tcg_pts_attr_simple_comp_evid_t, get_comp_evidence, pts_comp_evidence_t*,
private_tcg_pts_attr_simple_comp_evid_t *this)
{
return this->pcr_info_included;
}
METHOD(tcg_pts_attr_simple_comp_evid_t, get_flags, pts_attr_simple_comp_evid_flag_t,
private_tcg_pts_attr_simple_comp_evid_t *this)
{
return this->flags;
}
METHOD(tcg_pts_attr_simple_comp_evid_t, get_sub_component_depth, u_int32_t,
private_tcg_pts_attr_simple_comp_evid_t *this)
{
return this->depth;
}
METHOD(tcg_pts_attr_simple_comp_evid_t, get_comp_func_name, pts_comp_func_name_t*,
private_tcg_pts_attr_simple_comp_evid_t *this)
{
return this->name;
}
METHOD(tcg_pts_attr_simple_comp_evid_t, get_measurement_type, u_int8_t,
private_tcg_pts_attr_simple_comp_evid_t *this)
{
return this->measurement_type;
}
METHOD(tcg_pts_attr_simple_comp_evid_t, get_extended_pcr, u_int32_t,
private_tcg_pts_attr_simple_comp_evid_t *this)
{
return this->extended_pcr;
}
METHOD(tcg_pts_attr_simple_comp_evid_t, get_hash_algorithm, pts_meas_algorithms_t,
private_tcg_pts_attr_simple_comp_evid_t *this)
{
return this->hash_algorithm;
}
METHOD(tcg_pts_attr_simple_comp_evid_t, get_pcr_trans, pts_pcr_transform_t,
private_tcg_pts_attr_simple_comp_evid_t *this)
{
return this->transformation;
}
METHOD(tcg_pts_attr_simple_comp_evid_t, get_measurement_time, chunk_t,
private_tcg_pts_attr_simple_comp_evid_t *this)
{
return this->measurement_time;
}
METHOD(tcg_pts_attr_simple_comp_evid_t, get_policy_uri, chunk_t,
private_tcg_pts_attr_simple_comp_evid_t *this)
{
return this->policy_uri;
}
METHOD(tcg_pts_attr_simple_comp_evid_t, get_pcr_before_value, chunk_t,
private_tcg_pts_attr_simple_comp_evid_t *this)
{
return this->pcr_before;
}
METHOD(tcg_pts_attr_simple_comp_evid_t, get_pcr_after_value, chunk_t,
private_tcg_pts_attr_simple_comp_evid_t *this)
{
return this->pcr_after;
}
METHOD(tcg_pts_attr_simple_comp_evid_t, get_pcr_len, u_int16_t,
private_tcg_pts_attr_simple_comp_evid_t *this)
{
if (this->pcr_before.ptr && this->pcr_after.ptr &&
this->pcr_before.len == this->pcr_after.len &&
this->pcr_before.len > 0 && this->pcr_after.len > 0)
{
return this->pcr_before.len;
}
return 0;
}
METHOD(tcg_pts_attr_simple_comp_evid_t, get_comp_measurement, chunk_t,
private_tcg_pts_attr_simple_comp_evid_t *this)
{
return this->measurement;
return this->evidence;
}
/**
* Described in header.
*/
pa_tnc_attr_t *tcg_pts_attr_simple_comp_evid_create(tcg_pts_attr_simple_comp_evid_params_t params)
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;
@@ -476,35 +364,11 @@ pa_tnc_attr_t *tcg_pts_attr_simple_comp_evid_create(tcg_pts_attr_simple_comp_evi
.process = _process,
.destroy = _destroy,
},
.is_pcr_info_included = _is_pcr_info_included,
.get_flags= _get_flags,
.get_sub_component_depth = _get_sub_component_depth,
.get_comp_func_name = _get_comp_func_name,
.get_measurement_type = _get_measurement_type,
.get_extended_pcr = _get_extended_pcr,
.get_hash_algorithm = _get_hash_algorithm,
.get_pcr_trans = _get_pcr_trans,
.get_measurement_time = _get_measurement_time,
.get_policy_uri = _get_policy_uri,
.get_pcr_before_value = _get_pcr_before_value,
.get_pcr_after_value = _get_pcr_after_value,
.get_pcr_len = _get_pcr_len,
.get_comp_measurement = _get_comp_measurement,
.get_comp_evidence = _get_comp_evidence,
},
.vendor_id = PEN_TCG,
.type = TCG_PTS_SIMPLE_COMP_EVID,
.pcr_info_included = params.pcr_info_included,
.flags = params.flags,
.depth = params.depth,
.name = params.name,
.extended_pcr = params.extended_pcr,
.hash_algorithm = params.hash_algorithm,
.transformation = params.transformation,
.measurement_time = params.measurement_time,
.policy_uri = chunk_clone(params.policy_uri),
.pcr_before = params.pcr_before,
.pcr_after = params.pcr_after,
.measurement = params.measurement,
.evidence = evid,
);
return &this->public.pa_tnc_attribute;
@@ -530,20 +394,7 @@ pa_tnc_attr_t *tcg_pts_attr_simple_comp_evid_create_from_data(chunk_t data)
.process = _process,
.destroy = _destroy,
},
.is_pcr_info_included = _is_pcr_info_included,
.get_flags= _get_flags,
.get_sub_component_depth = _get_sub_component_depth,
.get_comp_func_name = _get_comp_func_name,
.get_measurement_type = _get_measurement_type,
.get_extended_pcr = _get_extended_pcr,
.get_hash_algorithm = _get_hash_algorithm,
.get_pcr_trans = _get_pcr_trans,
.get_measurement_time = _get_measurement_time,
.get_policy_uri = _get_policy_uri,
.get_pcr_before_value = _get_pcr_before_value,
.get_pcr_after_value = _get_pcr_after_value,
.get_pcr_len = _get_pcr_len,
.get_comp_measurement = _get_comp_measurement,
.get_comp_evidence = _get_comp_evidence,
},
.vendor_id = PEN_TCG,
.type = TCG_PTS_SIMPLE_COMP_EVID,
+6 -149
View File
@@ -22,63 +22,11 @@
#define TCG_PTS_ATTR_SIMPLE_COMP_EVID_H_
typedef struct tcg_pts_attr_simple_comp_evid_t tcg_pts_attr_simple_comp_evid_t;
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 struct tcg_pts_attr_simple_comp_evid_params_t tcg_pts_attr_simple_comp_evid_params_t;
#include "tcg_attr.h"
#include "pts/pts_meas_algo.h"
#include "pts/components/pts_comp_func_name.h"
#include "pts/components/pts_comp_evidence.h"
#include "pa_tnc/pa_tnc_attr.h"
#define PTS_SIMPLE_COMP_EVID_FAMILY_MASK 0xC0
/**
* PTS Simple Component Evidence Flags
*/
enum pts_attr_simple_comp_evid_flag_t {
/** No Validation was attempted */
PTS_SIMPLE_COMP_EVID_FLAG_NO_VALID = 1,
/** Attempted validation, unable to verify */
PTS_SIMPLE_COMP_EVID_FLAG_NO_VER = 2,
/** Attempted validation, verification failed */
PTS_SIMPLE_COMP_EVID_FLAG_VER_FAIL = 3,
/** Attempted validation, verification passed */
PTS_SIMPLE_COMP_EVID_FLAG_VER_PASS = 4,
};
/**
* PTS PCR Transformations
*/
enum pts_pcr_transform_t {
/** No Transformation */
PTS_PCR_TRANSFORM_NO = 0,
/** Hash Value matched PCR size */
PTS_PCR_TRANSFORM_MATCH = 1,
/** Hash value shorter than PCR size */
PTS_PCR_TRANSFORM_SHORT = 2,
/** Hash value longer than PCR size */
PTS_PCR_TRANSFORM_LONG = 3,
};
/**
* Parameters for Simple Component Evidence Attribute
*/
struct tcg_pts_attr_simple_comp_evid_params_t {
bool pcr_info_included;
pts_attr_simple_comp_evid_flag_t flags;
u_int32_t depth;
pts_comp_func_name_t *name;
u_int32_t extended_pcr;
pts_meas_algorithms_t hash_algorithm;
pts_pcr_transform_t transformation;
chunk_t measurement_time;
chunk_t policy_uri;
chunk_t pcr_before;
chunk_t pcr_after;
chunk_t measurement;
};
/**
* Class implementing the TCG PTS Simple Component Evidence attribute
*
@@ -91,111 +39,20 @@ struct tcg_pts_attr_simple_comp_evid_t {
pa_tnc_attr_t pa_tnc_attribute;
/**
* Is Optional PCR Information fields included
* Get Component Evidence
*
* @return TRUE if included, FALSE otherwise
* @return Component Evidence
*/
bool (*is_pcr_info_included)(tcg_pts_attr_simple_comp_evid_t *this);
/**
* Get flags for PTS Simple Component Evidence
*
* @return Set of flags
*/
pts_attr_simple_comp_evid_flag_t (*get_flags)(tcg_pts_attr_simple_comp_evid_t *this);
/**
* Get Sub-component Depth
*
* @return Sub-component Depth
*/
u_int32_t (*get_sub_component_depth)(tcg_pts_attr_simple_comp_evid_t *this);
/**
* Get Special Component Functional Name
*
* @return Component Functional Name
*/
pts_comp_func_name_t* (*get_comp_func_name)(tcg_pts_attr_simple_comp_evid_t *this);
/**
* Get Measurement Type
*
* @return Measurement Type
*/
u_int8_t (*get_measurement_type)(tcg_pts_attr_simple_comp_evid_t *this);
/**
* Get which PCR the functional component is extended into
*
* @return Number of PCR
*/
u_int32_t (*get_extended_pcr)(tcg_pts_attr_simple_comp_evid_t *this);
/**
* Get Hash Algorithm
*
* @return Hash Algorithm
*/
pts_meas_algorithms_t (*get_hash_algorithm)(tcg_pts_attr_simple_comp_evid_t *this);
/**
* Get PCR Transformation
*
* @return Transformation type of PCR
*/
pts_pcr_transform_t (*get_pcr_trans)(tcg_pts_attr_simple_comp_evid_t *this);
/**
* Get Measurement Time
*
* @return Measurement time
*/
chunk_t (*get_measurement_time)(tcg_pts_attr_simple_comp_evid_t *this);
/**
* Get Optional Policy URI
*
* @return Policy URI
*/
chunk_t (*get_policy_uri)(tcg_pts_attr_simple_comp_evid_t *this);
/**
* Get Optional PCR Length
*
* @return Length of PCR before/after values
*/
u_int16_t (*get_pcr_len)(tcg_pts_attr_simple_comp_evid_t *this);
/**
* Get Optional PCR before value
*
* @return PCR before value
*/
chunk_t (*get_pcr_before_value)(tcg_pts_attr_simple_comp_evid_t *this);
/**
* Get Optional PCR after value
*
* @return PCR after value
*/
chunk_t (*get_pcr_after_value)(tcg_pts_attr_simple_comp_evid_t *this);
/**
* Get Component Measurement
*
* @return Component Measurement Hash
*/
chunk_t (*get_comp_measurement)(tcg_pts_attr_simple_comp_evid_t *this);
pts_comp_evidence_t* (*get_comp_evidence)(tcg_pts_attr_simple_comp_evid_t *this);
};
/**
* Creates an tcg_pts_attr_simple_comp_evid_t object
*
* @param params Struct of parameters
* @param evid Component Evidence
*/
pa_tnc_attr_t* tcg_pts_attr_simple_comp_evid_create(tcg_pts_attr_simple_comp_evid_params_t params);
pa_tnc_attr_t* tcg_pts_attr_simple_comp_evid_create(pts_comp_evidence_t *evid);
/**
* Creates an tcg_pts_attr_simple_comp_evid_t object from received data