tpm2-tss  3.2.1
TPM Software stack 2.0 TCG spec compliant implementation
ifapi_profiles.h
1 /* SPDX-License-Identifier: BSD-2-Clause */
2 /*******************************************************************************
3  * Copyright 2018-2019, Fraunhofer SIT sponsored by Infineon Technologies AG
4  * All rights reserved.
5  ******************************************************************************/
6 
7 #ifndef IFAPI_PROFILES_H
8 #define IFAPI_PROFILES_H
9 
10 #include "ifapi_io.h"
11 #include "ifapi_policy_types.h"
12 
15 typedef struct IFAPI_PROFILE {
16  TPMI_ALG_PUBLIC type;
17  char *srk_template;
18  char *ek_template;
21  TPMT_SIG_SCHEME ecc_signing_scheme;
22  TPMT_SIG_SCHEME rsa_signing_scheme;
23  TPMT_RSA_DECRYPT rsa_decrypt_scheme;
24  TPMI_ALG_CIPHER_MODE sym_mode;
25  TPMT_SYM_DEF_OBJECT sym_parameters;
26  UINT16 sym_block_size;
27  TPML_PCR_SELECTION pcr_selection;
28  TPMI_ALG_HASH nameAlg;
29  TPMI_RSA_KEY_BITS keyBits;
30  UINT32 exponent;
31  TPMI_ECC_CURVE curveID;
32  TPMT_SYM_DEF session_symmetric;
33  TPMS_POLICY *eh_policy;
34  TPMS_POLICY *sh_policy;
35  TPMS_POLICY *ek_policy;
36  TPMS_POLICY *srk_policy;
37  TPMS_POLICY *lockout_policy;
38  UINT32 newMaxTries;
39  UINT32 newRecoveryTime;
40  UINT32 lockoutRecovery;
41  TPMI_YES_NO ignore_ek_template;
43 
44 /* An entry for the dictionary of loaded profiles */
45 typedef struct IFAPI_PROFILE_ENTRY {
47  char *name;
49  struct IFAPI_PROFILE profile;
51 
52 typedef struct IFAPI_PROFILES {
53  char *default_name;
54  struct IFAPI_PROFILE default_profile;
55  /* Dictionary of loaded profiles */
56  struct IFAPI_PROFILE_ENTRY *profiles;
57  char **filenames;
58  /* Size of the loaded profiles dictionary */
59  size_t num_profiles;
60  size_t profiles_idx;
62 
63 TSS2_RC
65  IFAPI_PROFILES *profiles,
66  IFAPI_IO *io,
67  const char *profilesdir,
68  const char *defaultprofile);
69 
70 TSS2_RC
72  IFAPI_PROFILES *profiles,
73  IFAPI_IO *io);
74 
75 TSS2_RC
77  const IFAPI_PROFILES *profiles,
78  const char *name,
79  const IFAPI_PROFILE **profile);
80 
81 void
83  IFAPI_PROFILES *profiles);
84 
85 #endif /* IFAPI_OBJECT_H */
TSS2_RC ifapi_profiles_get(const IFAPI_PROFILES *profiles, const char *name, const IFAPI_PROFILE **profile)
Definition: ifapi_profiles.c:241
TSS2_RC ifapi_profiles_initialize_finish(IFAPI_PROFILES *profiles, IFAPI_IO *io)
Definition: ifapi_profiles.c:154
TSS2_RC ifapi_profiles_initialize_async(IFAPI_PROFILES *profiles, IFAPI_IO *io, const char *profilesdir, const char *defaultprofile)
Definition: ifapi_profiles.c:57
void ifapi_profiles_finalize(IFAPI_PROFILES *profiles)
Definition: ifapi_profiles.c:287
Definition: ifapi_io.h:15
Definition: ifapi_profiles.h:45
char * name
Definition: ifapi_profiles.h:47
struct IFAPI_PROFILE profile
Definition: ifapi_profiles.h:49
Definition: ifapi_profiles.h:15
char * srk_description
Definition: ifapi_profiles.h:19
TPMT_SYM_DEF_OBJECT sym_parameters
Definition: ifapi_profiles.h:25
TPMT_RSA_DECRYPT rsa_decrypt_scheme
Definition: ifapi_profiles.h:23
TPMI_ALG_CIPHER_MODE sym_mode
Definition: ifapi_profiles.h:24
TPMT_SIG_SCHEME rsa_signing_scheme
Definition: ifapi_profiles.h:22
TPMT_SIG_SCHEME ecc_signing_scheme
Definition: ifapi_profiles.h:21
char * srk_template
Definition: ifapi_profiles.h:17
TPML_PCR_SELECTION pcr_selection
Definition: ifapi_profiles.h:27
UINT16 sym_block_size
Definition: ifapi_profiles.h:26
char * ek_description
Definition: ifapi_profiles.h:20
char * ek_template
Definition: ifapi_profiles.h:18
TPMI_ALG_PUBLIC type
Definition: ifapi_profiles.h:16
Definition: ifapi_profiles.h:52
Definition: ifapi_policy_types.h:275