1Tss2_TctiLdr_GetInfo(3) Library Functions Manual Tss2_TctiLdr_GetInfo(3)
2
3
4
6 Tss2_TctiLdr_GetInfo - Query TctiLdr library for the TSS2_TCTI_INFO
7 structure associated with a TCTI library.
8
10 #include <tss2/tss2_tctildr.h>
11
12
13 TSS2_RC Tss2_TctiLdr_GetInfo (constchar *name", TSS2_TCTI_INFO **info);
14
15
17 The Tss2_TctiLdr_GetInfo() function attempts to instantiate a
18 TSS2_TCTI_INFO structure appropriate for the TCTI library associated
19 with the provided name. The TSS2_TCTI_INFO* reference returned by this
20 function must be freed by the Tss2_TctiLdr_FreeInfo () function.
21
22 The name parameter is a C string. If this string is NULL then the li‐
23 brary will select a default TCTI for the caller. This is the same TCTI
24 library that will be used to initialize the context returned by
25 Tss2_TctiLdr_Initialize when passed a NULL name. If non-NULL, the
26 Tss2_TctiLdr_GetInfo () uses the same algorithm to map the string to
27 the name of an installed TCTI library as the Tss2_TctiLdr_Initialize ()
28 function.
29
30 The info parameter is a reference to a TSS2_TCTI_INFO*. The reference
31 returned will be allocated by the function and must be freed by the
32 caller.
33
35 A successful call to this function will return TSS2_RC_SUCCESS. An un‐
36 successful call to this function will return a response code described
37 below in section ERRORS.
38
40 TSS2_TCTI_RC_MEMORY is returned if memory allocation fails
41
42 TSS2_TCTI_RC_NOT_SUPPORTED is returned when the loader is unable to lo‐
43 cate a TCTI library with the provided name
44
45 TSS2_TCTI_RC_IO_ERROR is returned if a failure occurs in the underlying
46 library loading mechanism
47
48 TSS2_TCTI_RC_BAD_REFERENCE is returned if the info parameter is NULL
49
50
52 Example code.
53
54 #include <inttypes.h>
55 #include <stdlib.h>
56 #include <stdio.h>
57
58 #include <tss2/tss2_tctildr.h>
59
60 TSS2_TCTI_INFO *info = NULL;
61 TSS2_RC rc = Tss2_TctiLdr_GetInfo (NULL, &info);
62 if (rc != TSS2_RC_SUCCESS) {
63 fprintf (stderr, "Initialization of default TCTI context failed with "
64 "response code: 0x%" PRIx32 "0, rc);
65 exit (EXIT_FAILURE);
66 }
67
68 if (info != NULL) {
69 Tss2_TctiLdr_FreeInfo (info);
70 info = NULL;
71 }
72
73 exit (EXIT_SUCCESS);
74
76 TPM2 Software Project <https://github.com/tpm2-software/tpm2-tss>
77
79 Tss2_Tcti_Device_Init(3), Tss2_Tcti_Socket_Init(3), Tss2_TctiLdr_Ini‐
80 tialize(3), Tss2_TctiLdr_Finalize(3), tcti-device(7), tcti-socket(7),
81 tcti-tabrmd(7), tpm2-abrmd(8)
82
84 This page is part of release 4.0.1 of Open Source implementation of the
85 TCG TPM2 Software Stack (TSS2). A description of the project, informa‐
86 tion about reporting bugs, and the latest version of this page can be
87 found at https://github.com/tpm2-software/tpm2-tss/.
88
89
90
91TPM2 Software Stack JUNE 2019 Tss2_TctiLdr_GetInfo(3)