aboutsummaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2018-03-01tss2_tcti.h: Remove 'extern C' stuff.Philip Tricca
This isn't required, and isn't in the spec, because this header exposes no symbols that C++ would mangle. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-03-01tcti: Update structures to v2 TCTI structures & functions.Philip Tricca
This makes us compatible with the latest spec on the TCG site. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-03-01marshal: add support for TPMU_NAME typeTadeusz Struk
TPMU_NAME type is a special case of the TPMU_ types, which doesn't have a explicit selector. The value of the size is used instead as a selector as specified in the TCG spec, part2, 10.5.3 section: "The type of Name in the structure is determined by context and the size parameter. If size is four, then the Name is a handle. If size is zero, then no Name is present. Otherwise, the size shall be the size of a TPM_ALG_ID plus the size of the digest produced by the indicated hash algorithm." Fixes: #720 Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2018-02-28tcti: Generalize version struct and add to INFO struct as first member.Philip Tricca
This addresses feedback from TSS2 WG: The INFO structure should be versioned just like we do the context structure. The two version structures must be identical for both structures. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-02-28sys_api_part3.h: Remove old *_Out structures.Philip Tricca
These look like leftovers from an old prototype that never came to be? Either way it's not in the TSS2 specs and so it has got to go. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-02-28sapi: cleanup tss2_sys.hTadeusz Struk
Fixes: #679 Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2018-02-27sapi: fix CreateLoadedTadeusz Struk
The CreateLoaded implementation needs to take TPM2B_TEMPLATE type instead of TPM2B_PUBLIC. Fixes: #797 Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2018-02-27marshal: add marshaling functions for TPM2B_TEMPLATETadeusz Struk
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2018-02-27sapi: add definiton of TPM2B_TEMPLATE typeTadeusz Struk
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2018-02-28sapi: clean tss2_sys.hTadeusz Struk
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2018-02-28sapi: remove bitfields definitions from tpm2_types.hTadeusz Struk
The bitfields are not used anymore. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2018-02-28sapi: More header cleanupsTadeusz Struk
Cleanup tss2_tpm2_types.h Fixes: #675 Fixes: #735 Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2018-02-27sapi: change version to the latest defined by specTadeusz Struk
Currently the spec defines ABI version to TSS2_API_VERSION_1_2_1_108. Update rest of the headers respectively. Also some style cleanups and use C style comments instead of C++. Fixes #674 Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2018-02-26ESAPI: Add special handling for NV-OperationsJuergen Repp
Add the recalculation of public names for response authorization to NV_Increment and NV_SetBits. Signed-off-by: Juergen Repp <juergen.repp@sit.fraunhofer.de>
2018-02-25tss2_tcti.h: Use types for TCTI function pointers.Philip Tricca
This requires fixing a few of our deviations from the spec. Both the device and socket TCTIs got the transmit function wrong. Fixing this requires adding the `const` qualifier to the 3rd parameter. This required the `send_checks` function prototype be updated as well. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-02-25tss2_tcti.h: Remove old function invocation macros.Philip Tricca
The spec uses a different naming convention (case only). Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-02-25tss2_tcti.h: Return BAD_CONTEXT not BAD_REFERENCE if context is NULL.Philip Tricca
This is what's in the spec. The difference is academic. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-02-25tss2_tcti.h: Remove version guard.Philip Tricca
This requires fixing up some includes now that we don't benefit from the pile of stuff included through tpm20.h. Took this opportunity to rearrange the order of included files as well. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-02-25tss2_tcti.h: Use only C style comments, append '_H' to header guard.Philip Tricca
Minor cleanup. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-02-23tcti: Fix API compatibility with TCTI transmit function.Philip Tricca
The spec has the 3rd parameter to the transmit function with the 'const' qualifier. We were missing this and this patch resolves the API breakage. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-02-23libtcti-socket: Remove 'SendSessionEndSocketTcti' function from header.Philip Tricca
This should never have been exposed through the public headers in the first place. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-02-23libtcti-socket: Cleanup PlatformCommand and use 'read' not 'recv'.Philip Tricca
This function did some fancy stuff to marshal small integers into UINT32s. It was only accepting UINT8s via the input parameter and then storing them into the 3rd byte of a 4 byte buffer. This is what the type marshalling library is for so we replace this with much less clever and much more readable code. This patch also replaces the use of 'recv' with 'read' since we weren't doing anything with the flags / socket specific. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-02-22tcti: Use C style comment block for license header & some cleanup.Philip Tricca
Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-02-22tcti: Clean out remnants of old logging infrastructure.Philip Tricca
This should have come out back when the new stuff in the log/log.h was added. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-02-21sapi: add TPM2PolicyAuthorizeNV commandTadeusz Struk
Add support for TPM2_CCPolicyAuthorizeNV command. Fixes #682 Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2018-02-16esapi: Include esys_types.h from esys_int.h instead of public headers.Philip Tricca
If it's not under $(srcdir)/include then it doesn't get installed on the host. The file 'esys_types.h' is under $(srcdir)/esapi/include so it's not installed but tss2_esys.h includes this file. This effectively breaks the ESAPI headers but only when they're installed. It seems like only esys_int.h gets broken when this is removed so the include has been moved to this file instead. Fuchs: Adapted to changed directory layout. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com> Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de>
2018-02-16ESAPI: Added support for ESAPIJuergen Repp
Add support for esapi as code, include files and Makefiles Signed-off-by: Juergen Repp <juergen.repp@sit.fraunhofer.de> Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de>
2018-02-16TPM-Types: Add missing defines of spec 1.38Andreas Fuchs
Add two new defines to TPM-Types that were introduced with TPM spec 1.38 and the corresponding latest TSS spec. Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de>
2018-02-02sapi: add TPM2_CreateLoaded commandTadeusz Struk
Add support for TPM2_CC_CreateLoaded command. Fixes #861 Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2018-02-01sapi: add TPM2_PolicyTemplate commandTadeusz Struk
Add support for TPM2_CC_PolicyTemplate command. Fixes #680 Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2018-01-31tss2_tcti.h: Define TCTI poll handle type for _WIN32 platforms.Philip Tricca
On windows this should be a HANDLE. This requires that we include windows.h first. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-01-31Include local headersKristen Carlson Accardi
Modify the source code to use #include "" so that the compiler will look for the header locally prior to checking the system include path. Fixes: #687 Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
2018-01-22tcti-socket: Deprecate the old InitSocketTcti function,Philip Tricca
This is mechanically similar to the previous patch deprecating the old init function from the device TCTI. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-01-22tcti-device: Deprecate the old InitDeviceTcti function.Philip Tricca
We use the gcc 'deprecated' attribute to generate compiler warnings for consumers building against this branch. This required some fixups in the test harness were all references to the deprecated function are now replaced by the Tss2_Tcti_Device_Init function. During the transiton from the old to the new init functions we've had to define a private version of the old function to alow its use internally through a function that isn't marked as 'deprecated'. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-01-22header: Include 'common.h' using local / "" form.Philip Tricca
The common.h file should never be discovered through the system include path. Only the TCTI headers should include this file and they should do so using "" notation. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-01-09tcti-socket: Move TCTI_SOCKET_DEFAULT macro to public header.Philip Tricca
Update help string to reference the macro instead of the connection string directly. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-01-09tcti-device: Move TCTI_DEVICE_DEFAULT macro to public header.Philip Tricca
Update help string to reference the macro instead of the default device path directly. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-01-09tcti: Add 'TSS2_' prefix to TCTI_INFO_SYMBOL macro.Philip Tricca
The TSS2_ prefix is how the TCG specs attempt prevent conflicts with symbols / macros from other libraries / headers. Since this macro is in a public header it should have this prefix. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-01-08tcti-socket: Add common Info and Init function.Philip Tricca
These are implementations of the common discovery / initialization functions. Using dlopen, dlsym and the types / structures / constants from the tss2_tcti.h header this allows for the socket TCTI to be initialized and configured dynamically. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-01-08tcti-device: Implement common Info and Init function.Philip Tricca
These are implementations of the common discovery / initialization mechanisms. Using dlopen, dlsym and the types / structures / constants from the tss2_tcti.h header this allows for the device TCTI to be initialized and configured dynamically. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-01-08tss2_tcti.h: Add structurs and types for common TCTI initialization.Philip Tricca
This should be sufficient to enable instatiation of a TSS2_TCTI_CONTEXT structure by: 1) using the dynamic linker to dlopen a TCTI shared object 2) exstract the symbol to the `Tss2_Tcti_Info` function using dlsym 3) call the `Info` function to retrieve a reference to a static instance of a TSS2_TCTI_INFO struct from the shared object 4) invoke the `Tss2_Tcti_Init` function through the pointer in the INFO struct Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-01-07Define TPMS_EMPTY structure to have a BYTE array with a single member.Philip Tricca
If define as an array with 0 members this causes pedantic C compilers to complain of the invalid 0 sized array (disallowed by c99). Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-01-04tcti: Remove unused log data from device TCTI config structure.Philip Tricca
These fields have been unused since 43a0d76bf4e8f50b164a8be89102f1de03d46fa6. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-01-04TCTI: Update to new logging frameworkAndreas Fuchs
Update TCTI modules to new logging framework. Removing the callback function for logging that were not specification compliant. Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de>
2018-01-03Remove final semicolon from definition of TPM2B_TYPE2 macro.Philip Tricca
According to ISO c99 additional semicolons outside of a function are not allowed. When we use the TPM2B_TYPE2 macro (exclusively in tss2_tpm2_types.h) we put a semicolon after it: TPM2B_TYPE2( SENSITIVE_CREATE, TPMS_SENSITIVE_CREATE, sensitive ); With the macro as it was this would define the TPM2B_* structure like so: typedef struct { UINT16 size; type buffer_name; } TPM2B_*;; The two semicolons at the end of the typedef will cause a compiler strictly adhearing to ISO c99 to complain: ./include/sapi/tss2_tpm2_types.h:1566:66: error: ISO C does not allow extra ‘;’ outside of a function TPM2B_TYPE2( SENSITIVE_CREATE, TPMS_SENSITIVE_CREATE, sensitive ); Removing the semicolon from the definition of the TPM2B_TYPE2 macro resolves this issue. Alternatively we could have removed the semicolon from the locations where we call this macro. The approach taken in this patch was chosen since it has a smaller impact on the code base (LOCs changed). Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2018-01-02SAPI: Add missing _complete calls to header fileAndreas Fuchs
Commit 090641a missed adding _complete functions to the header files as well. This adds the _complete functions to the headers. Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de>
2018-01-02SAPI: Add missing const qualifier for IncremetalSelfTestAndreas Fuchs
Add the missing const qualifier for Tss2_Sys_IncrementalSelfTest Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de>
2017-12-29sapi: Add SAPI functions for Attached Component commandsTadeusz Struk
Add SAPI functions for the TPM2_AC_GetCapability, TPM2_AC_Send, and TPM2_Policy_AC_SendSelect commands. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2017-12-29marshal: add marshaling functions for AC typesTadeusz Struk
Add marshaling functions for the Attached Component types. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2017-12-29sapi: Add TPM2 AC related commandsTadeusz Struk
Add support for the TPM2 Attached Component commands. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>