finished refactoring functional components
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#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>
|
||||
@@ -47,6 +48,12 @@ METHOD(pts_component_t, get_comp_func_name, pts_comp_func_name_t*,
|
||||
return this->name;
|
||||
}
|
||||
|
||||
METHOD(pts_component_t, get_evidence_flags, u_int8_t,
|
||||
pts_ita_comp_tboot_t *this)
|
||||
{
|
||||
return PTS_REQ_FUNC_COMP_FLAG_PCR;
|
||||
}
|
||||
|
||||
METHOD(pts_component_t, measure, bool,
|
||||
pts_ita_comp_tboot_t *this)
|
||||
{
|
||||
@@ -78,6 +85,7 @@ pts_component_t *pts_ita_comp_tboot_create(u_int8_t qualifier)
|
||||
INIT(this,
|
||||
.public = {
|
||||
.get_comp_func_name = _get_comp_func_name,
|
||||
.get_evidence_flags = _get_evidence_flags,
|
||||
.measure = _measure,
|
||||
.verify = _verify,
|
||||
.destroy = _destroy,
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#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>
|
||||
@@ -47,6 +48,12 @@ METHOD(pts_component_t, get_comp_func_name, pts_comp_func_name_t*,
|
||||
return this->name;
|
||||
}
|
||||
|
||||
METHOD(pts_component_t, get_evidence_flags, u_int8_t,
|
||||
pts_ita_comp_tgrub_t *this)
|
||||
{
|
||||
return PTS_REQ_FUNC_COMP_FLAG_PCR;
|
||||
}
|
||||
|
||||
METHOD(pts_component_t, measure, bool,
|
||||
pts_ita_comp_tgrub_t *this)
|
||||
{
|
||||
@@ -78,6 +85,7 @@ pts_component_t *pts_ita_comp_tgrub_create(u_int8_t qualifier)
|
||||
INIT(this,
|
||||
.public = {
|
||||
.get_comp_func_name = _get_comp_func_name,
|
||||
.get_evidence_flags = _get_evidence_flags,
|
||||
.measure = _measure,
|
||||
.verify = _verify,
|
||||
.destroy = _destroy,
|
||||
|
||||
@@ -39,6 +39,13 @@ struct pts_component_t {
|
||||
*/
|
||||
pts_comp_func_name_t* (*get_comp_func_name)(pts_component_t *this);
|
||||
|
||||
/**
|
||||
* Get the PTS Component Evidence Flags
|
||||
*
|
||||
* @return PTS Component Functional Name
|
||||
*/
|
||||
u_int8_t (*get_evidence_flags)(pts_component_t *this);
|
||||
|
||||
/**
|
||||
* Do measurements on the PTS Functional Component
|
||||
*
|
||||
|
||||
@@ -30,7 +30,7 @@ typedef struct pcr_entry_t pcr_entry_t;
|
||||
#include "pts_file_meas.h"
|
||||
#include "pts_file_meta.h"
|
||||
#include "pts_dh_group.h"
|
||||
#include "pts_funct_comp_evid_req.h"
|
||||
#include "pts_func_comp_evid_req.h"
|
||||
#include "components/pts_comp_func_name.h"
|
||||
#include "components/tcg/tcg_comp_func_name.h"
|
||||
#include "components/ita/ita_comp_func_name.h"
|
||||
|
||||
@@ -14,23 +14,17 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup pts_funct_comp_evid_req pts_funct_comp_evid_req
|
||||
* @defgroup pts_func_comp_evid_req pts_func_comp_evid_req
|
||||
* @{ @ingroup pts
|
||||
*/
|
||||
|
||||
#ifndef PTS_FUNCT_COMP_EVID_REQ_H_
|
||||
#define PTS_FUNCT_COMP_EVID_REQ_H_
|
||||
#ifndef PTS_FUNC_COMP_EVID_REQ_H_
|
||||
#define PTS_FUNC_COMP_EVID_REQ_H_
|
||||
|
||||
typedef struct pts_funct_comp_evid_req_t pts_funct_comp_evid_req_t;
|
||||
typedef enum pts_attr_req_funct_comp_evid_flag_t pts_attr_req_funct_comp_evid_flag_t;
|
||||
typedef struct funct_comp_evid_req_entry_t funct_comp_evid_req_entry_t;
|
||||
|
||||
#include "pts/components/pts_comp_func_name.h"
|
||||
typedef enum pts_attr_req_func_comp_evid_flag_t pts_attr_req_func_comp_evid_flag_t;
|
||||
|
||||
#include <library.h>
|
||||
|
||||
#define PTS_REQ_FUNCT_COMP_FAM_BIN_ENUM 0x00
|
||||
|
||||
/**
|
||||
* PTS Request Functional Component Evidence Flags
|
||||
*/
|
||||
@@ -38,60 +32,11 @@ enum pts_attr_req_funct_comp_evid_flag_t {
|
||||
/** Transitive Trust Chain flag */
|
||||
PTS_REQ_FUNC_COMP_FLAG_TTC = (1<<7),
|
||||
/** Verify Component flag */
|
||||
PTS_REQ_FUNC_COMP_FLAG_VER = (1<<6),
|
||||
PTS_REQ_FUNC_COMP_FLAG_VER = (1<<6),
|
||||
/** Current Evidence flag */
|
||||
PTS_REQ_FUNC_COMP_FLAG_CURR = (1<<5),
|
||||
PTS_REQ_FUNC_COMP_FLAG_CURR = (1<<5),
|
||||
/** PCR Information flag */
|
||||
PTS_REQ_FUNC_COMP_FLAG_PCR = (1<<4),
|
||||
PTS_REQ_FUNC_COMP_FLAG_PCR = (1<<4),
|
||||
};
|
||||
|
||||
/**
|
||||
* PTS Functional Component Evidence Request entry
|
||||
*/
|
||||
struct funct_comp_evid_req_entry_t {
|
||||
pts_attr_req_funct_comp_evid_flag_t flags;
|
||||
u_int32_t sub_comp_depth;
|
||||
pts_comp_func_name_t *name;
|
||||
};
|
||||
|
||||
/**
|
||||
* Class storing PTS Functional Component Evidence Request
|
||||
*/
|
||||
struct pts_funct_comp_evid_req_t {
|
||||
|
||||
/**
|
||||
* Get the number of requested components
|
||||
*
|
||||
* @return Number of requested components
|
||||
*/
|
||||
int (*get_req_count)(pts_funct_comp_evid_req_t *this);
|
||||
|
||||
/**
|
||||
* Add a PTS File Measurement
|
||||
*
|
||||
* @param entry PTS Functional Component Evidence Request entry
|
||||
*/
|
||||
void (*add)(pts_funct_comp_evid_req_t *this,
|
||||
funct_comp_evid_req_entry_t *entry);
|
||||
|
||||
/**
|
||||
* Create a PTS Functional Component Evidence Request enumerator
|
||||
*
|
||||
* @return Enumerator returning flags, sub-component depth and
|
||||
* functional component name
|
||||
*/
|
||||
enumerator_t* (*create_enumerator)(pts_funct_comp_evid_req_t *this);
|
||||
|
||||
/**
|
||||
* Destroys a pts_funct_comp_evid_req_t object.
|
||||
*/
|
||||
void (*destroy)(pts_funct_comp_evid_req_t *this);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a pts_funct_comp_evid_req_t object
|
||||
*/
|
||||
pts_funct_comp_evid_req_t* pts_funct_comp_evid_req_create();
|
||||
|
||||
#endif /** PTS_FUNCT_COMP_EVID_REQ_H_ @}*/
|
||||
|
||||
Reference in New Issue
Block a user