Commit Graph

73 Commits (master)

Author SHA1 Message Date
Aidan Garske d5bf86b372 F-15796 - Clear native ECDH shared points 2026-10-16 09:15:55 -07:00
David Garske 428c4c29d1 Skip example paths for features the TPM does not implement 2026-09-23 09:33:53 -07:00
aidan garske 32ef758dae 6741 - Use rsaDec label size for RSA Decrypt label copy in native_test 2026-07-07 12:57:46 -07:00
aidan garske 367aa04bfb examples: propagate test failures, fix handle range check, free PEM buffer 2026-06-09 12:22:03 -07:00
aidan garske fa616ac090 F-4157 — Fix native_test hash check using && instead of || 2026-05-26 12:13:11 -07:00
Aidan Garske 6d90662cfa F-3921 - Restore goto exit on TPM2_ObjectChangeAuth failure in native_test 2026-05-11 20:16:37 -07:00
David Garske 28c30eedb8 Peer review fixes 2026-04-23 11:11:59 -07:00
David Garske 664ad70336 Enhance the TPM 2 native_test to include additional ECC curves (P384). 2026-04-23 07:25:50 -07:00
David Garske 0f87ce183b Build, portability, and CI fixes for v4.0.0
- configure.ac: switch wolfCrypt link probe to AC_LINK_IFELSE with real
  headers so CC=g++ builds don't fail on name-mangling; gate fwTPM/swTPM
  autodetect on ENABLED_WOLFCRYPT=yes (fwTPM requires wolfCrypt)
- wolftpm/fwtpm/fwtpm.h: hoist FWTPM_NV_HAL_S and FWTPM_CLOCK_HAL_S out
  of the FWTPM_CTX nested scope so C++ consumers can reference them
- src/fwtpm/fwtpm_command.c, fwtpm_crypto.c: add explicit TPMI_ALG_HASH
  and enum wc_HashType casts to silence strict C++ warnings; drop stale
  KEYEDHASH hashAlg initializer
- src/tpm2_wrap.c: move rc = TPM_RC_SUCCESS into the correct #else branch
  so Linux/winapi paths propagate TPM2_Startup errors
- examples/endorsement/get_ek_certs.c: drop redundant indexType default
- examples/endorsement/verify_ek_cert.c: initialize curveName on the
  WOLFTPM2_NO_WOLFCRYPT/no-ECC path
- examples/native/native_test.c: stop masking TPM2_ZGen_2Phase and
  TPM2_EC_Ephemeral 'command unavailable' as success
- tests/fwtpm_unit_tests.c: use cmdSz (not hardcoded 14) on FlushContext
- CI: add no-examples and st33ktpm2-i2c compile-only matrix entries to
  make-test-swtpm; add release-checks workflow (CC=g++ + scan-build)
2026-04-22 09:27:48 -07:00
David Garske 579ec8cc7f Bump copyright year to 2026 and version to 4.0.0
Release prep for v4.0.0:
- Copyright headers updated 2025 -> 2026 across sources, headers, and examples
- Library version 3.10.0 -> 4.0.0 (libtool 16:8:0 -> 17:0:0)
- configure.ac WOLFSSL_URL http -> https
2026-04-22 09:24:55 -07:00
David Garske 0c52f3be4d Add firmware TPM 2.0 (fwTPM) implementation
Add portable firmware TPM 2.0 implementation (fwTPM) built on wolfCrypt.
Implements 105/113 TPM 2.0 v1.38 commands (93%) as a standalone server
with socket and TIS transports, NV storage, and full CI/fuzz coverage.
2026-04-16 16:57:57 -07:00
David Garske b042e4da67 Fixes for build and testing with `--enable-infineon=9670`. Additional build tests. 2025-11-21 19:57:58 +00:00
David Garske 1402d0d132 wolfTPM Release v3.9.2 prep. Migrating to GPLv3. 2025-07-30 07:29:31 -07:00
David Garske 6fbb49a94f wolfTPM Release v3.9.0. Updated copyright and version. 2025-05-14 15:31:07 -07:00
David Garske 53feb3fb96 Add support for TPM2_GetCapability for TPM_CAP_PCRS. ZD 18881
Improve PCR extend to support -alg option.
2024-10-30 12:57:08 -07:00
David Garske a6d7ed8695 Added example for `TPM2_Certify`:
* Added new build option for TPM provisioning (`--enable-provisioning` on by default).
* Added new `wolfTPM2_CreatePrimaryKey_ex` and `WOLFTPM2_PKEY` that supports returning creation ticket/hash.
* Added key templates for initial device (IDevID) and attestation keys (IAK).
* Extended `create_primary` example to support creation or IDevID and IAK.
* Added new policy hash helper API `wolfTPM2_PolicyHash`
* Switch handle/nvIndex string parsing to use `strtoul`.

ZD 18347
2024-08-22 10:38:01 -07:00
gojimmypi fb19d7a0e1 Initial Infineon I2C TPM support for Espressif ESP32 2024-05-10 14:16:39 -07:00
David Garske c98ee9a71e Update copyright date. 2024-04-24 10:42:27 -07:00
David Garske 626beaf4d7 Fixes for native_test with ST33 and `TPM2_GetRandom2`. 2024-03-20 15:23:44 -07:00
David Garske b395b65287 Fix for config.h, which should only be included from .c files, not headers. ZD 17473 2024-02-07 14:28:33 -08:00
David Garske 4c753683c2 Fix native test `TPM2_PolicyPCR`. 2023-12-29 09:21:44 -08:00
John Bland ae280a7e71
fix casting and unused variable problems on windows (#255) 2023-01-27 14:34:02 -08:00
David Garske c05bf659c2 Fix broken paths with HAL refactor. Update TLS examples to use latest TLS version (allowing downgrade). 2023-01-20 08:29:53 -08:00
David Garske 1ea4a591a8 HAL refactor and documentation improvements. Move example HAL implementations into new `hal` directory. Include the example HAL in the library when building. Updated HAL IO documentation. 2023-01-18 12:38:04 -08:00
David Garske 3f84b2efbc wolfTPM v2.5.0 release prep 2022-07-22 09:32:57 -07:00
Elms fd1474c68b cmake: Add to readme and fix native test 2022-04-07 10:55:15 -07:00
Elms 084ef170b7 cmake: windows fixes and spell fixes
* Examples working on Windows and SWTPM
 * Check command availability (including for windows blocking it).
 * update unseal to work without persistent NV storage
* cleanup cmake from review
* fix a few spelling mistakes
2022-04-07 10:55:11 -07:00
Elms f2b7bec392 cmake: Initial cmake build
Includes fixes for windows builds using both msys and MSVC
2022-04-07 10:54:52 -07:00
David Garske a2613bcae7 Fix for `TPM2_GetRandom2` to fallback to normal command if not found. Some older STM33 TPM firmware does not support this command. Fix to make sure we don't request more random data than the response can physically handle. 2022-02-04 09:51:09 -08:00
David Garske 4ced78d002 Added test for `TPM2_GetRandom2` 2022-02-04 09:28:03 -08:00
Elms ede184c735 configure: keep example directory strcuture during install 2021-11-18 12:04:41 -08:00
David Garske 0f9e8b5768 wolfTPM Release v2.3.0 2021-11-08 15:49:00 -08:00
Elms 02b8834244 test: Allow `CreateLoaded` to pass on unsupported systems
Some hardware may not support these, but allow native and wrap tests to pass with comment
2021-07-26 11:18:33 -07:00
David Garske 54d3fea42b Fix for mismatch memset size. 2021-07-22 11:33:13 -07:00
Dimitar Tomov 8528a326be Added fixes and unit tests for wolfTPM2_CreateLoadedKey and TPM2_CreateLoaded
* Added new units tests and fixed missing XMEMSET
* Renamed and modified PemToTpm to PubPemToTpm, works only with Pub keys
* Fixes from peer feedback

Signed-off-by: Dimitar Tomov <dimi@wolfssl.com>
2021-07-12 15:09:28 -07:00
Dimitar Tomov 21e6a74d8b Added unit test for TPM2_CertifyCreation
In a real-life use case, signHandle and objectHandle would
point to different objects. For unit testing, signHandle and
objectHandle can be the same object, because wolfTPM performs
the TPM2_CertifyCreation command the same.

Signed-off-by: Dimitar Tomov <dimi@wolfssl.com>
2021-05-31 19:51:32 +03:00
David Garske 2b8cfb8692 wolfTPM Release v2.1.0 preparation.
* Updated copyright
* Fixed minor cast warning.
* Fixed minor scan-build warnings.
* Cleanup print public and fix possible print of uninitialized field.
2021-03-17 10:13:50 -07:00
Elms d9360f035a test: exit with 0 if test not supported by hardware
`native_test` attempts tests that may not be supported by hardware.
In these cases, warnings are printed, but the exectuable should still
return 0 for success.
2021-03-08 09:15:51 -08:00
David Garske 845b3d1da2 Release fixes and cleanups. Fixes for init of `WOLFTPM2_HASH` in `wolfTPM2_HashStart`. Fix for for various build configurations (--disable-wrapper). Fix for Microchip "sign" bit on symmetric keys. Fix for scan-build warnings. Cleanup whitespace. 2020-12-07 11:01:02 -08:00
David Garske 75db91c003 Updates to demonstrate using parameter encryption with the native test. Allow NULL key for the HmacSetKey (for unsalted / unbound). 2020-12-01 16:00:47 -08:00
David Garske 4b0b70861c Added parameter encryption support to more examples. Fix to not set "encrypt" or "decrypt" if command doesn't allow it. Updated documentation. 2020-11-30 12:00:54 -08:00
David Garske 0e4c6672fd TPM Parameter Encryption with AES CFB or XOR is fully working. Tested keygen, keyload, keyimport and PCR quote with parameter encryption using both ciphers. This commit includes a refactor of the auth command structure to adhere to TPM spec. Includes optimization for AES CFB and XOR to do done inline. For for the decryption nonce to use the newer for U in KDFa. 2020-11-25 13:00:42 -08:00
David Garske 409fd96502 Fixes for response decryption. Nonce from TPM captured correctly now. Added support for args to all examples. 2020-11-24 16:44:20 -08:00
David Garske dbd8e41b47 Refactor of the session authentication. Added "-e" option to some examples to enable parameter encryption and removed the _paramenc.c files. Fixup for the `getPrimaryStoragekey` to allow persisting if not `WOLFTPM_WINAPI`. Improve command line options. Added calculation of command hash and HMAC for sessions. 2020-11-20 16:47:14 -08:00
Dimitar Tomov 0ad05b9554 Fix whitespaces and tabs in include.am files
Signed-off-by: Dimitar Tomov <dimi@designfirst.ee>
2020-07-17 18:09:52 +03:00
David Garske 6d46b26bde Added dynamic module detection at run-time when using internal TIS. 2020-07-13 09:55:36 -07:00
Dimitar Tomov 1f7e612ba1 Add TPM2 native API test for ReadClock
Signed-off-by: Dimitar Tomov <dimi@designfirst.ee>
2020-05-26 17:05:23 +03:00
Dimitar Tomov 90d47ae5a3 Add TPM2 native API test for TPM2_PCR_Reset
Signed-off-by: Dimitar Tomov <dimi@designfirst.ee>
2020-05-13 15:53:43 +03:00
Chris Conlon 91ef0b0e6e update copyright to 2020 2020-01-03 15:31:27 -08:00
David Garske 7887130287 wolfTPM v1.7 Release 2019-12-27 14:43:30 -08:00