ifapi_profiles.h
/* SPDX-License-Identifier: BSD-2-Clause */
/*******************************************************************************
* Copyright 2018-2019, Fraunhofer SIT sponsored by Infineon Technologies AG
* All rights reserved.
******************************************************************************/
#ifndef IFAPI_PROFILES_H
#define IFAPI_PROFILES_H
#include "ifapi_io.h"
#include "ifapi_policy_types.h"
typedef struct IFAPI_PROFILE {
TPMI_ALG_PUBLIC type;
char *srk_template;
char *ek_template;
char *srk_description;
char *ek_description;
TPMT_SIG_SCHEME ecc_signing_scheme;
TPMT_SIG_SCHEME rsa_signing_scheme;
TPMT_RSA_DECRYPT rsa_decrypt_scheme;
TPMI_ALG_CIPHER_MODE sym_mode;
TPMT_SYM_DEF_OBJECT sym_parameters;
UINT16 sym_block_size;
TPML_PCR_SELECTION pcr_selection;
TPMI_ALG_HASH nameAlg;
TPMI_RSA_KEY_BITS keyBits;
UINT32 exponent;
TPMI_ECC_CURVE curveID;
TPMT_SYM_DEF session_symmetric;
TPMS_POLICY *eh_policy;
TPMS_POLICY *sh_policy;
TPMS_POLICY *ek_policy;
TPMS_POLICY *srk_policy;
TPMS_POLICY *lockout_policy;
UINT32 newMaxTries;
UINT32 newRecoveryTime;
UINT32 lockoutRecovery;
TPMI_YES_NO ignore_ek_template;
} IFAPI_PROFILE;
/* An entry for the dictionary of loaded profiles */
typedef struct IFAPI_PROFILE_ENTRY {
char *name;
struct IFAPI_PROFILE profile;
} IFAPI_PROFILE_ENTRY;
typedef struct IFAPI_PROFILES {
char *default_name;
struct IFAPI_PROFILE default_profile;
/* Dictionary of loaded profiles */
struct IFAPI_PROFILE_ENTRY *profiles;
char **filenames;
/* Size of the loaded profiles dictionary */
size_t num_profiles;
size_t profiles_idx;
} IFAPI_PROFILES;
TSS2_RC
ifapi_profiles_initialize_async(
IFAPI_PROFILES *profiles,
IFAPI_IO *io,
const char *profilesdir,
const char *defaultprofile);
TSS2_RC
ifapi_profiles_initialize_finish(
IFAPI_PROFILES *profiles,
IFAPI_IO *io);
TSS2_RC
ifapi_profiles_get(
const IFAPI_PROFILES *profiles,
const char *name,
const IFAPI_PROFILE **profile);
void
ifapi_profiles_finalize(
IFAPI_PROFILES *profiles);
#endif /* IFAPI_OBJECT_H */
ifapi_profiles_get
TSS2_RC ifapi_profiles_get(const IFAPI_PROFILES *profiles, const char *name, const IFAPI_PROFILE **profile)
Definition ifapi_profiles.c:242
ifapi_profiles_initialize_finish
TSS2_RC ifapi_profiles_initialize_finish(IFAPI_PROFILES *profiles, IFAPI_IO *io)
Definition ifapi_profiles.c:155
ifapi_profiles_initialize_async
TSS2_RC ifapi_profiles_initialize_async(IFAPI_PROFILES *profiles, IFAPI_IO *io, const char *profilesdir, const char *defaultprofile)
Definition ifapi_profiles.c:58
ifapi_profiles_finalize
void ifapi_profiles_finalize(IFAPI_PROFILES *profiles)
Definition ifapi_profiles.c:288
IFAPI_IO
Definition ifapi_io.h:15
IFAPI_PROFILE_ENTRY
Definition ifapi_profiles.h:45
IFAPI_PROFILE_ENTRY::name
char * name
Definition ifapi_profiles.h:47
IFAPI_PROFILE_ENTRY::profile
struct IFAPI_PROFILE profile
Definition ifapi_profiles.h:49
IFAPI_PROFILE
Definition ifapi_profiles.h:15
IFAPI_PROFILE::srk_description
char * srk_description
Definition ifapi_profiles.h:19
IFAPI_PROFILE::sym_parameters
TPMT_SYM_DEF_OBJECT sym_parameters
Definition ifapi_profiles.h:25
IFAPI_PROFILE::rsa_decrypt_scheme
TPMT_RSA_DECRYPT rsa_decrypt_scheme
Definition ifapi_profiles.h:23
IFAPI_PROFILE::sym_mode
TPMI_ALG_CIPHER_MODE sym_mode
Definition ifapi_profiles.h:24
IFAPI_PROFILE::rsa_signing_scheme
TPMT_SIG_SCHEME rsa_signing_scheme
Definition ifapi_profiles.h:22
IFAPI_PROFILE::ecc_signing_scheme
TPMT_SIG_SCHEME ecc_signing_scheme
Definition ifapi_profiles.h:21
IFAPI_PROFILE::srk_template
char * srk_template
Definition ifapi_profiles.h:17
IFAPI_PROFILE::pcr_selection
TPML_PCR_SELECTION pcr_selection
Definition ifapi_profiles.h:27
IFAPI_PROFILE::sym_block_size
UINT16 sym_block_size
Definition ifapi_profiles.h:26
IFAPI_PROFILE::ek_description
char * ek_description
Definition ifapi_profiles.h:20
IFAPI_PROFILE::ek_template
char * ek_template
Definition ifapi_profiles.h:18
IFAPI_PROFILE::type
TPMI_ALG_PUBLIC type
Definition ifapi_profiles.h:16
IFAPI_PROFILES
Definition ifapi_profiles.h:52
TPMS_POLICY
Definition ifapi_policy_types.h:275