Skip to content

Commit 62eff27

Browse files
committed
Updated CMake to include new examples. Fixed doxygen issue with wolfTPM2_GetKeyTemplate_EK -> curveID. Fixed issue with possible create key timeout by always adding XTPM_WAIT for Linux.
1 parent 642beec commit 62eff27

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,17 +291,25 @@ if (WOLFTPM_EXAMPLES)
291291
add_tpm_example(make_credential attestation/make_credential.c)
292292
add_tpm_example(bench bench/bench.c)
293293
add_tpm_example(csr csr/csr.c)
294+
add_tpm_example(get_ek_certs endorsement/get_ek_certs.c)
295+
add_tpm_example(ifx_fw_extract firmware/ifx_fw_extract.c)
296+
add_tpm_example(ifx_fw_update firmware/ifx_fw_update.c)
294297
add_tpm_example(gpio_config gpio/gpio_config.c)
295298
add_tpm_example(gpio_read gpio/gpio_read.c)
296299
add_tpm_example(gpio_set gpio/gpio_set.c)
300+
add_tpm_example(create_primary keygen/create_primary.c)
301+
add_tpm_example(external_import keygen/external_import.c)
297302
add_tpm_example(keygen keygen/keygen.c)
298303
add_tpm_example(keyimport keygen/keyimport.c)
299304
add_tpm_example(keyload keygen/keyload.c)
300305
add_tpm_example(flush management/flush.c)
301306
add_tpm_example(native_test native/native_test.c)
307+
add_tpm_example(counter nvram/counter.c)
308+
add_tpm_example(policy_nv nvram/policy_nv.c)
302309
add_tpm_example(read nvram/read.c)
303310
add_tpm_example(store nvram/store.c)
304311
add_tpm_example(extend pcr/extend.c)
312+
add_tpm_example(policy_sign pcr/policy_sign.c)
305313
add_tpm_example(quote pcr/quote.c)
306314
add_tpm_example(read_pcr pcr/read_pcr.c)
307315
add_tpm_example(reset pcr/reset.c)

wolftpm/tpm2_types.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -432,16 +432,15 @@ typedef int64_t INT64;
432432
/* ---------------------------------------------------------------------------*/
433433

434434
/* Optional delay between polling */
435-
#if (defined(WOLFTPM_SLB9670) || defined(WOLFTPM_SLB9672)) && !defined(XTPM_WAIT)
436-
/* For Infineon SLB9670 and SLB9672 adding 10us delay improves performance
435+
#if defined(__linux__) && !defined(XTPM_WAIT)
436+
/* Avoid excessive polling.
437+
* For Infineon SLB9670 and SLB9672 adding 10us delay improves performance
437438
* and prevents issue with rapid use at higher speeds */
438-
#ifdef __linux__
439-
#ifndef XTPM_WAIT_POLLING_US
440-
#define XTPM_WAIT_POLLING_US 10 /* 0.01ms */
441-
#endif
442-
#include <unistd.h>
443-
#define XTPM_WAIT() usleep(XTPM_WAIT_POLLING_US);
439+
#ifndef XTPM_WAIT_POLLING_US
440+
#define XTPM_WAIT_POLLING_US 10 /* 0.01ms */
444441
#endif
442+
#include <unistd.h>
443+
#define XTPM_WAIT() usleep(XTPM_WAIT_POLLING_US);
445444
#endif
446445
#ifndef XTPM_WAIT
447446
#define XTPM_WAIT() /* just poll without delay by default */

wolftpm/tpm2_wrap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2684,7 +2684,7 @@ WOLFTPM_API int wolfTPM2_GetKeyTemplate_KeySeal(TPMT_PUBLIC* publicTemplate, TPM
26842684
\param publicTemplate pointer to an empty structure of TPMT_PUBLIC type, to store the new template
26852685
\param alg can be only TPM_ALG_RSA or TPM_ALG_ECC, see Note above
26862686
\param keyBits integer value, specifying bits for the key, typically 2048 (RSA) or 256 (ECC)
2687-
\param curveId use one of the accepted TPM_ECC_CURVE values like TPM_ECC_NIST_P256 (only used when alg=TPM_ALG_ECC)
2687+
\param curveID use one of the accepted TPM_ECC_CURVE values like TPM_ECC_NIST_P256 (only used when alg=TPM_ALG_ECC)
26882688
\param nameAlg integer value of TPMI_ALG_HASH type, specifying a valid TPM2 hashing algorithm (typically TPM_ALG_SHA256)
26892689
\param highRange integer value: 0=low range, 1=high range
26902690

0 commit comments

Comments
 (0)