aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPhilip Tricca <philip.b.tricca@intel.com>2019-07-09 16:13:19 -0700
committerAndreas Fuchs <andreas.fuchs@sit.fraunhofer.de>2019-07-25 10:48:24 +0200
commitbe796453eac88172f93e0c5ce7538e4fff27c869 (patch)
tree6b07d92523e0d1ff78ba8c7437497f6f9c1e985c /lib
parent0d6e704df13fa07856d7f2d75e0412fd45dc62b5 (diff)
downloadtpm2-tss-be796453eac88172f93e0c5ce7538e4fff27c869.tar.gz
tctildr: Add library to automate TCTI lifecycle.
Instantiating a TCTI context takes a bit of work. The default offered by ESYS is a good start but this still leaves applications that need to override the default with a lot of extra work. libtss2-tctildr will do this work for you. It provides: - Tss2_TctiLdr_Initialize - Allocate and initialize a TCTI context for the caller. The 'name' parameter is a string that is either passed to dlopen, or mapped to an internal table of names to TCTIs linked directly into the loader. - Tss2_TctiLdr_Finalize - The dual of 'Initialize'. 'Initialize' returns a TCTI instance that can be used by the existing SYS & ESYS APIs. When no longer in use it must be freed using the paired 'Finalize' function. This implementation reuses the esys_tcti_default module to preserve existing behavior / default TCTI selection logic as much as possible. The interface however is very different as callers may now search for TCTIs using the 'name' parameter of Tss2_TctiLdr_Initialize. When this parameter is NULL the old default selection logic is used to select a default TCTI. When it is populated the library will attempt to load it. On a system with 'dlopen' we simply pass the provided name through which requires the caller provide the full name of the TCTI library (i.e. libtss2-tcti-device.so.0). For the NO_DL case this commit introduces a lookup mechanism for common TCTI names that we compare to the provided 'name'. The ESYS unit tests have been updated and new unit tests added to cover the dl & nodl, and tctildr modules. The build (both autotools and visual studio) has been updated to include rules to build this new library and to update dependencies: - tss2-esys no longer depnds on the TCTIs directly - tss2-esys now depends on tss2-tctildr This includes a page in section 7 for the library itself as well as individual pages in section 3 for the initialize and finalize functions. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/tss2-tctildr.def4
-rw-r--r--lib/tss2-tctildr.map7
-rw-r--r--lib/tss2-tctildr.pc.in11
3 files changed, 22 insertions, 0 deletions
diff --git a/lib/tss2-tctildr.def b/lib/tss2-tctildr.def
new file mode 100644
index 00000000..56a1c8a8
--- /dev/null
+++ b/lib/tss2-tctildr.def
@@ -0,0 +1,4 @@
+LIBRARY tss2-tctildr
+EXPORTS
+ Tss2_TctiLdr_Finalize
+ Tss2_TctiLdr_Initialize
diff --git a/lib/tss2-tctildr.map b/lib/tss2-tctildr.map
new file mode 100644
index 00000000..f90dba4e
--- /dev/null
+++ b/lib/tss2-tctildr.map
@@ -0,0 +1,7 @@
+{
+ global:
+ Tss2_TctiLdr_Finalize;
+ Tss2_TctiLdr_Initialize;
+ local:
+ *;
+};
diff --git a/lib/tss2-tctildr.pc.in b/lib/tss2-tctildr.pc.in
new file mode 100644
index 00000000..0f18b75b
--- /dev/null
+++ b/lib/tss2-tctildr.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+includedir=@includedir@
+libdir=@libdir@
+
+Name: tss2-tctildr
+Description: Library to simplify management of TCTIs.
+URL: https://github.com/tpm2-software/tpm2-tss
+Version: @VERSION@
+Cflags: -I@includedir@
+Libs: -ltss2-tctildr -L@libdir@