1 /******************************************************************************* 2 * Copyright 2018-2019, Fraunhofer SIT sponsored by Infineon Technologies AG 3 * All rights reserved. 4 *******************************************************************************/ 5 #ifndef FAPI_POLICYUTIL_EXECUTE_H 6 #define FAPI_POLICYUTIL_EXECUTE_H 7 8 #include <stdint.h> 9 #include <stdarg.h> 10 #include <stdbool.h> 11 #include <sys/stat.h> 12 #include <json-c/json.h> 13 #include <json-c/json_util.h> 14 15 #include "tss2_esys.h" 16 #include "tss2_fapi.h" 17 18 19 /** The states for the FAPI's policy util execution */ 20 enum IFAPI_STATE_POLICY_UTIL_EXEC { 21 POLICY_UTIL_INIT, 22 POLICY_UTIL_EXEC_POLICY, 23 }; 24 25 /** The context of the policy execution */ 26 struct IFAPI_POLICYUTIL_STACK { 27 ESYS_TR policy_session; /**< The policy session created for the current evaluation */ 28 IFAPI_POLICY_EXEC_CTX *pol_exec_ctx; /**< The execution context for the current policy */ 29 enum IFAPI_STATE_POLICY_UTIL_EXEC state; 30 IFAPI_POLICYUTIL_STACK *next; /**< Pointer to next policy */ 31 IFAPI_POLICYUTIL_STACK *prev; /**< Pointer to previous policy */ 32 }; 33 34 TSS2_RC 35 ifapi_policyutil_execute_prepare( 36 FAPI_CONTEXT *context, 37 TPMI_ALG_HASH hash_alg, 38 TPMS_POLICY *policy); 39 40 TSS2_RC 41 ifapi_policyutil_execute( 42 FAPI_CONTEXT *context, 43 ESYS_TR *session); 44 45 #endif /* FAPI_POLICYUTIL_EXECUTE_H */ 46