Age | Commit message (Collapse) | Author |
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Update help string to reference the macro instead of the connection
string directly.
Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
|
|
Update help string to reference the macro instead of the default device
path directly.
Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
These fields have been unused since
43a0d76bf4e8f50b164a8be89102f1de03d46fa6.
Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
|
|
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>
|
|
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>
|
|
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>
|
|
Add the missing const qualifier for Tss2_Sys_IncrementalSelfTest
Signed-off-by: Andreas Fuchs <andreas.fuchs@sit.fraunhofer.de>
|
|
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>
|
|
Add marshaling functions for the Attached Component types.
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
|
|
Add support for the TPM2 Attached Component commands.
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
|
|
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>
|
|
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>
|
|
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>
|
|
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Remove unions from TPM2B structures. There is no need for the unions.
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
|
|
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>
|
|
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>
|
|
MAX_ACTIVE_SESSIONS1 isn't defined, this should instead be
MAX_ACTIVE_SESSIONS - 1
Signed-off-by: Philip Tricca <philip.b.tricca@intel.com>
|
|
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>
|
|
Add missing function declarations of the tpm2b types.
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
|
|
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>
|
|
Remove redefinition of the MAX macro. It is already defined in
line #397
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
|
|
Cleanup some unused TPM2B defines.
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|