diff options
author | Philip Tricca <philip.b.tricca@intel.com> | 2019-06-21 19:27:18 -0700 |
---|---|---|
committer | Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de> | 2019-07-25 10:48:24 +0200 |
commit | 24014ec453ae7d44d28fa9f21775680354166149 (patch) | |
tree | 2ec91323e9536a486f08e5b579188c480a40824e /include | |
parent | ebb398e2d491b955ee80c1273919943b678084be (diff) | |
download | tpm2-tss-24014ec453ae7d44d28fa9f21775680354166149.tar.gz |
tctildr: Add Tss2_TctiLdr_GetInfo
This function will find the TCTI library that maps to the 'name'
parameter and return a *duplicate* TSS2_TCTI_INFO structure to the
caller. This function is particularly useful for applications looking to
query known TCTIs (something the tools currently do).
The implementation uses the same algorithm as the TctiLdr_Initialize
function to map 'name' to a TCTI library. If 'name' is NULL then
the same algorithm inherited from ESYS is used to select a
default TCTI. When the caller is done with the reference returned it
must be freed using the 'Tss2_TctiLdr_FreeInfo' function.
This makes for some code duplication between the logic behind
GetInfo and Initialize. Refactoring this is future work.
Windows and some older OSX versions don't support strndup. This commit
adds the necessary machinery to autotools to detect the absence of this
command. This is used in the code to fall back to a custom
implementation also added in this commit.
Documentation for these two new functions is added to the collection of
man pages too.
Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/tss2/tss2_tctildr.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/tss2/tss2_tctildr.h b/include/tss2/tss2_tctildr.h index f589dff6..bfb74e98 100644 --- a/include/tss2/tss2_tctildr.h +++ b/include/tss2/tss2_tctildr.h @@ -20,5 +20,10 @@ Tss2_TctiLdr_Initialize_Ex (const char *name, TSS2_RC Tss2_TctiLdr_Initialize (const char *nameConf, TSS2_TCTI_CONTEXT **context); +TSS2_RC +Tss2_TctiLdr_GetInfo (const char *name, + TSS2_TCTI_INFO **info); +void +Tss2_TctiLdr_FreeInfo (TSS2_TCTI_INFO **info); #endif /* TSS2_TCTILDR_H */ |