tpm2-tss 4.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 <stddef.h> // for size_t
11
12#include "ifapi_io.h" // for IFAPI_IO
13#include "ifapi_policy_types.h" // for TPMS_POLICY
14#include "tss2_common.h" // for UINT32, TSS2_RC, UINT16
15#include "tss2_tpm2_types.h" // for TPMT_SIG_SCHEME, TPMI_ALG_CIPHER_MODE
16
19typedef struct IFAPI_PROFILE {
20 TPMI_ALG_PUBLIC type;
25 TPMT_SIG_SCHEME ecc_signing_scheme;
26 TPMT_SIG_SCHEME rsa_signing_scheme;
27 TPMT_RSA_DECRYPT rsa_decrypt_scheme;
28 TPMI_ALG_CIPHER_MODE sym_mode;
29 TPMT_SYM_DEF_OBJECT sym_parameters;
31 TPML_PCR_SELECTION pcr_selection;
32 TPMI_ALG_HASH nameAlg;
33 TPMI_RSA_KEY_BITS keyBits;
34 UINT32 exponent;
35 TPMI_ECC_CURVE curveID;
36 TPMT_SYM_DEF session_symmetric;
37 TPMS_POLICY *eh_policy;
38 TPMS_POLICY *sh_policy;
39 TPMS_POLICY *ek_policy;
40 TPMS_POLICY *srk_policy;
41 TPMS_POLICY *lockout_policy;
42 UINT32 newMaxTries;
43 UINT32 newRecoveryTime;
44 UINT32 lockoutRecovery;
45 TPMI_YES_NO ignore_ek_template;
47
48/* An entry for the dictionary of loaded profiles */
55
56typedef struct IFAPI_PROFILES {
57 char *default_name;
58 struct IFAPI_PROFILE default_profile;
59 /* Dictionary of loaded profiles */
60 struct IFAPI_PROFILE_ENTRY *profiles;
61 char **filenames;
62 /* Size of the loaded profiles dictionary */
63 size_t num_profiles;
64 size_t profiles_idx;
66
67TSS2_RC
69 IFAPI_IO *io,
70 const char *profilesdir,
71 const char *defaultprofile);
72
73TSS2_RC
75
76TSS2_RC
77ifapi_profiles_get(const IFAPI_PROFILES *profiles, const char *name, const IFAPI_PROFILE **profile);
78
80
81#endif /* IFAPI_OBJECT_H */
TSS2_RC ifapi_profiles_get(const IFAPI_PROFILES *profiles, const char *name, const IFAPI_PROFILE **profile)
Definition ifapi_profiles.c:233
TSS2_RC ifapi_profiles_initialize_finish(IFAPI_PROFILES *profiles, IFAPI_IO *io)
Definition ifapi_profiles.c:152
TSS2_RC ifapi_profiles_initialize_async(IFAPI_PROFILES *profiles, IFAPI_IO *io, const char *profilesdir, const char *defaultprofile)
Definition ifapi_profiles.c:52
void ifapi_profiles_finalize(IFAPI_PROFILES *profiles)
Definition ifapi_profiles.c:277
Definition ifapi_io.h:17
Definition ifapi_profiles.h:49
char * name
Definition ifapi_profiles.h:51
struct IFAPI_PROFILE profile
Definition ifapi_profiles.h:53
Definition ifapi_profiles.h:19
char * srk_description
Definition ifapi_profiles.h:23
TPMT_SYM_DEF_OBJECT sym_parameters
Definition ifapi_profiles.h:29
TPMT_RSA_DECRYPT rsa_decrypt_scheme
Definition ifapi_profiles.h:27
TPMI_ALG_CIPHER_MODE sym_mode
Definition ifapi_profiles.h:28
TPMT_SIG_SCHEME rsa_signing_scheme
Definition ifapi_profiles.h:26
TPMT_SIG_SCHEME ecc_signing_scheme
Definition ifapi_profiles.h:25
char * srk_template
Definition ifapi_profiles.h:21
TPML_PCR_SELECTION pcr_selection
Definition ifapi_profiles.h:31
UINT16 sym_block_size
Definition ifapi_profiles.h:30
char * ek_description
Definition ifapi_profiles.h:24
char * ek_template
Definition ifapi_profiles.h:22
TPMI_ALG_PUBLIC type
Definition ifapi_profiles.h:20
Definition ifapi_profiles.h:56
Definition ifapi_policy_types.h:281