aboutsummaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
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>
2017-12-05Headers: Fixing macros for error levels (to rc layers)Andreas Fuchs
The names of error macros changed with the latest spec. Notably, ERROR_LEVEL turned to RC_LAYER. Also adding RCs for the MUAPI. Also banning non-standard APP_RC_LAYER into the tpmclient test suit. Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de>
2017-12-01sysapi: Update SetCmdAuths and GetRspAuths to new parameter typeAndreas Fuchs
Since the last iteration of the specification there is just a struct with an array directly embedded. This is a large change, but removes a lot of complexity. Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de> Signed-off-by: Juergen Repp <juergen.repp@sit.fraunhofer.de>
2017-11-30sysapi: Fixes about GetCommandCodeAndreas Fuchs
This patch updates the function signature to reflect the latest specification version. Further, it make the GetCommandCode function safe to use with non-aligned arrays. Also it fixes the tests to account for correct endianess. Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de> Signed-off-by: Juergen Repp <juergen.repp@sit.fraunhofer.de>
2017-11-29Enable for poll.h include for OS XDavid R. Bild
2017-11-28marshal: remove the fake na member from TPMUTadeusz Struk
There is no need to add the fake members to TPMU. We can use the first member of the union instead. That way we don't have to polute the TPM types. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2017-11-28MU: Add missing marshaling functionsAndreas Fuchs
Added marshaling and unmarshaling for TPM2_HANDLE, TPMI_ALG_HASH, TPM2_SE, TPM2B_NONCE, TPMS_EMPTY, BYTE Also removed some duplicates from map-file. Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de> Signed-off-by: Juergen Repp <juergen.repp@sit.fraunhofer.de>
2017-11-22tpm-types: Switch TPMAs from struct to definesAndreas Fuchs
As per spec, the representation of TPMAs as bitfield structs is not correct anymore. Instead defines for the values shall be used. This patch adapts the types, marshalling and tests to this new appraoch, whilst still retaining the old struct representation for the moment. Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de>
2017-11-22tcti: Change macro function names to CamelCaseAndreas Fuchs
As per latest spec, the tcti function macros are written in camel case. This patch changes these makros accordingly. Also updates the tests to use the CamelCase fucntion macros instead of the deprecated lowercase ones. Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de> Signed-off-by: Juergen Repp <juergen.repp@sit.fraunhofer.de>
2017-11-16All: Changed namespace from TPM_ to TPM2_Andreas Fuchs
According to the specification the TPM types shall reside in the namespace TPM2_ in order to not collide with TPM 1.2 things. Accordingly, moved all entries from TPM_ to TPM2_ and also all non-namespcaed definition to TPM2_ Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de> Signed-off-by: Juergen Repp <juergen.repp@sit.fraunhofer.de> Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2017-11-16includes: Removed implementation.hAndreas Fuchs
implementation.h is not really wanted. This patch removes it and merges necessary defines into tss2_tpm2_types.h Also some values change, e.g. NUM_PCRs is now 32 Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de> Signed-off-by: Juergen Repp <juergen.repp@sit.fraunhofer.de> Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2017-11-16SAPI: Added const to SAPI function parametersAndreas Fuchs
Input pointers to SAPI functions should contain const qualifiers. This patch adds these qualifiers to all SAPI functions. Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de> Signed-off-by: Juergen Repp <juergen.repp@sit.fraunhofer.de>
2017-11-16Change TPM_RC to TSS2_RC.Andreas Fuchs
The spec defines TSS2_RC as the default return type of all functions. Most functions used TPM_RC as a type thus far. This patch changes return types to TSS2_RC all throughout the project. Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de> Signed-off-by: Juergen Repp <juergen.repp@sit.fraunhofer.de>
2017-11-08sysapi: simplify TPM2B structuresTadeusz Struk
Remove unions from TPM2B structures. There is no need for the unions. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2017-10-26Add implementation of EncryptDecrypt2 function and integration test.Philip Tricca
This function was missing since our implementation was originally based on the 1.16 spec version. This function was added in the 1.38. Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2017-10-24sysapi: add support for Intel PTT capabilityTadeusz Struk
Add support for Intel PTT specific capability query. Ported from 1.x branch PR: #505 "Ptt capabilities" Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2017-10-23tss2_tpm2_types.h: Fix typo in HMAC_SESSION_LAST and POLICY_SESSION_LAST.Philip Tricca
MAX_ACTIVE_SESSIONS1 isn't defined, this should instead be MAX_ACTIVE_SESSIONS - 1 Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
2017-10-19sysapi: remove unneeded marshaling wrappersTadeusz Struk
The wrappers are not needed anymore so remove them. The simple_TPM2B_(Un)marshal helpers and TPM2B unit test are also removed. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2017-10-19libmu: add missing function declarationsTadeusz Struk
Add missing function declarations of the tpm2b types. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2017-10-10libmu: convert names to comply with TCG specTadeusz Struk
The function signatures and header file names have to be updated to comply with TCG marshaling specification [1]. [1] https://trustedcomputinggroup.org/wp-content/uploads/TSS_Marshaling_v1.0_r03_Public-Review.pdf Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2017-08-15Remove duplicate definition on MAXTadeusz Struk
Remove redefinition of the MAX macro. It is already defined in line #397 Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2017-08-15Cleanup unused TPM2B codeTadeusz Struk
Cleanup some unused TPM2B defines. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2017-08-14TPM_Types: fix TPMA_* type sizeTadeusz Struk
In the UINT8 TPMA types, the struct should bedefined as unsigned char instead unsigned int. If unsigned int is used then, for example sizeof(TPMA_LOCALITY) == 4, but sizeof(TPMA_LOCALITY.val) == 1 Issue found with unit test. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2017-08-08Marshal: Add marshalling for the rest of TPM typesTadeusz Struk
Marshalling routines for the rest of the TPM types, which was dependent on each other hence had to be done together. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2017-08-08Marshal: Add marshal/unmarshal for TPMT typesTadeusz Struk
Add marshalling and unmarshalling functions for TPMT types as described in TCG TSS 2.0 Marshalling/Unmarshalling API Specification Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2017-08-08Marshal: Add marshal/unmarshal for TPMU typesTadeusz Struk
Add marshalling and unmarshalling functions for TPMU types as described in TCG TSS 2.0 Marshalling/Unmarshalling API Specification Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2017-08-08Marshal: Add marshal/unmarshal for TPML typesTadeusz Struk
Add marshalling and unmarshalling functions for TPML types as described in TCG TSS 2.0 Marshalling/Unmarshalling API Specification Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2017-08-08Marshal: Add marshal/unmarshal for TPMS typesTadeusz Struk
Add marshalling and unmarshalling functions for TPMS types as described in TCG TSS 2.0 Marshalling/Unmarshalling API Specification Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2017-08-08Marshal: Add marshal/unmarshal for TPM2B typesTadeusz Struk
Add marshalling and unmarshalling functions for TPM2B types as described in TCG TSS 2.0 Marshalling/Unmarshalling API Specification Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2017-08-08Marshal: Add marshal/unmarshal for TPMA typesTadeusz Struk
Add marshalling and unmarshalling functions for TPMA types as described in TCG TSS 2.0 Marshalling/Unmarshalling API Specification Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
2017-08-08Marshal: Generalize base typesTadeusz Struk
Generalize marshling of TPM Base types. Also some minor cleanups in implementation.h and tss2_tpm2_types.h Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>