tpm2-tss  3.2.0
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;
42 
43 /* An entry for the dictionary of loaded profiles */
44 typedef struct IFAPI_PROFILE_ENTRY {
46  char *name;
48  struct IFAPI_PROFILE profile;
50 
51 typedef struct IFAPI_PROFILES {
52  char *default_name;
53  struct IFAPI_PROFILE default_profile;
54  /* Dictionary of loaded profiles */
55  struct IFAPI_PROFILE_ENTRY *profiles;
56  char **filenames;
57  /* Size of the loaded profiles dictionary */
58  size_t num_profiles;
59  size_t profiles_idx;
61 
62 TSS2_RC
64  IFAPI_PROFILES *profiles,
65  IFAPI_IO *io,
66  const char *profilesdir,
67  const char *defaultprofile);
68 
69 TSS2_RC
71  IFAPI_PROFILES *profiles,
72  IFAPI_IO *io);
73 
74 TSS2_RC
76  const IFAPI_PROFILES *profiles,
77  const char *name,
78  const IFAPI_PROFILE **profile);
79 
80 void
82  IFAPI_PROFILES *profiles);
83 
84 #endif /* IFAPI_OBJECT_H */
TPMT_SYM_DEF_OBJECT sym_parameters
Definition: ifapi_profiles.h:25
Definition: ifapi_io.h:15
char * name
Definition: ifapi_profiles.h:46
TPMT_SIG_SCHEME ecc_signing_scheme
Definition: ifapi_profiles.h:21
char * srk_description
Definition: ifapi_profiles.h:19
TSS2_RC ifapi_profiles_initialize_finish(IFAPI_PROFILES *profiles, IFAPI_IO *io)
Definition: ifapi_profiles.c:154
UINT16 sym_block_size
Definition: ifapi_profiles.h:26
Definition: ifapi_profiles.h:51
char * srk_template
Definition: ifapi_profiles.h:17
TSS2_RC ifapi_profiles_initialize_async(IFAPI_PROFILES *profiles, IFAPI_IO *io, const char *profilesdir, const char *defaultprofile)
Definition: ifapi_profiles.c:57
Definition: ifapi_policy_types.h:291
TPMI_ALG_PUBLIC type
Definition: ifapi_profiles.h:16
struct IFAPI_PROFILE profile
Definition: ifapi_profiles.h:48
Definition: ifapi_profiles.h:44
char * ek_template
Definition: ifapi_profiles.h:18
TPMT_RSA_DECRYPT rsa_decrypt_scheme
Definition: ifapi_profiles.h:23
Definition: ifapi_profiles.h:15
TPML_PCR_SELECTION pcr_selection
Definition: ifapi_profiles.h:27
void ifapi_profiles_finalize(IFAPI_PROFILES *profiles)
Definition: ifapi_profiles.c:287
TPMT_SIG_SCHEME rsa_signing_scheme
Definition: ifapi_profiles.h:22
TPMI_ALG_CIPHER_MODE sym_mode
Definition: ifapi_profiles.h:24
char * ek_description
Definition: ifapi_profiles.h:20
TSS2_RC ifapi_profiles_get(const IFAPI_PROFILES *profiles, const char *name, const IFAPI_PROFILE **profile)
Definition: ifapi_profiles.c:241