Commit Graph

95 Commits (8b8bd479a48a510c6cdb32b888e58a2cda28355c)

Author SHA1 Message Date
Aidan Garske 8b8bd479a4 wolfTPM Zephyr Project Port #395 - Work by @aidangarske, @night1rider, and @dgarske 2025-05-14 13:56:08 -07:00
Zackery 33a5f47eaf
Merge pull request #398 from aidangarske/uboot_support
wolfTPM Support For Das U-Boot Bootloader
2025-05-06 18:17:56 -06:00
David Garske e7aad1ac22 Support for pthread static mutex when building against older wolfSSL versions (like 5.6.6). 2025-05-02 12:48:24 -07:00
Aidan Garske f31929609f Rebase wolfTPM Support For Das U-Boot Bootloader 2025-04-25 13:28:09 -07:00
David Garske 7c48b76548 Support for building wolfTPM against older wolfCrypt (like v4.7.0). 2024-12-13 09:45:52 -08:00
David Garske ebf7a6c7fb Add parsing of remaining capabilities. 2024-10-30 13:57:44 -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
David Garske 026c82f799 Fixes and new tests for building wolfCrypt/wolfTPM without ECC or RSA. Fixes ZD 18470. Improved smallstack (eliminated `WOLFTPM2_MAX_BUFFER`). Fixes for building with NO_ASN. 2024-08-19 09:55:15 -07:00
David Garske 62eff27459 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. 2024-07-30 13:21:45 -07:00
gojimmypi 5aff694c3f XSLEEP_MS is vTaskDelay for all FREERTOS, not just ESPIDF 2024-05-13 13:05:21 -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 892726e6b5 Added support for Infineon SLB9672/SLB9673 Firmware upgrade (see examples/firmware/README.md)
Added Infineon Modus Toolbox support. See `wolfssl/IDE/Infineon/README.md` for setup instructions.
Added support for Infineon CyHal I2C support.
Added Firmware extraction tool
Added Firmware update example application `examples/firmware/ifx_fw_update`.
Added support for vendor capabilities `TPM_CAP_VENDOR_PROPERTY`.
Added `XSLEEP_MS` macro for firmware update delay.
Added support for getting key group id, operational mode and update counts.
Added support for abandoning an update.
Added support for firmware update done, but not finalized
Fix auto-detect to not define SLB9672/SLB9673.
2024-04-01 17:21:18 -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 a2a45d2a3d Match byte swap logic with wolfSSL (use WOLF_ALLOW_BUILTIN). 2024-01-26 14:26:54 -08:00
David Garske b27e6c5874 Remove unused `XHTONS` and `arpa/inet.h`. 2024-01-26 14:26:54 -08:00
David Garske fb2ea5b315 Fixes for compiler type warnings. Add `WOLFTPM_NO_LOCK`. Improve STM IO options/logging. 2023-12-20 11:54:02 -08:00
David Garske e601803f1b Added support for PK callbacks with RSA Sign using PKCSv1.5 and PSS.
Fixes for building wolfTPM without crypto callbacks.
Fixes for building/running with FIPS.
2023-12-01 08:25:53 -08:00
David Garske 249f9d4942 Fixes for building wolfCrypt without PEM to DER support. 2023-11-15 21:53:50 -08:00
Tesfa Mael df89f497e5 Remove error-ssl.h 2023-11-01 17:17:28 -07:00
David Garske 5b6c7c0368 Improvements to the secure_rot example. Add support for manually placing hash. 2023-08-15 14:41:09 -07:00
David Garske 5a20647313 Minor cleanups. Update wolfSSL test certs. Added TPM_TIS_MAX_WAIT. Fix build with WOLFTPM_DEBUG_VERBOSE only. 2023-08-07 11:08:02 -07:00
Lealem Amedie b468d7d29a Adding STM23 Expansion Pack 2023-07-28 14:51:39 -06:00
John Bland fafd0c2780 include user_settings.h manually when wolfCrypt is not in use 2023-07-27 16:04:25 -04:00
David Garske 97b4f62ac6 Fix for import of private key with seed. Added new API `wolfTPM2_ImportPrivateKeyBuffer` for importing private key ECC/RSA in either PEM or DER(ASN.1). ZD16249 2023-07-18 18:21:10 -07:00
David Garske d28738310a Make sure the file IO XFEOF and XREWIND are available (not defined in wolfSSL). 2023-07-07 09:53:57 -07:00
David Garske 50bf4beb08
Merge pull request #271 from rizlik/mmio
support memory mapped tpms
2023-06-28 16:53:48 -07:00
John Bland 8981aa64be undefine HAVE_THREAD_LS if NO_THREAD_LS is defined 2023-06-02 14:52:04 -04:00
Marco Oliverio d0beda2d71 types.h: add typedef for address sized integer 2023-05-30 16:58:12 +00:00
John Bland b4a8ba698e
Sealing secrets with PolicyPCR and PolicyAuthorize (#261)
* Support for PCR with policy. Issue #109

* Progress on PCR policy. Work from John Bland.

* add wrapper functions to seal secrets the NVM with policy authorization

fix the seal and unseal with policy functions to work with non trial policies

update policy examples to allow multiple pcr indicies to be used, currently only 2 can be used because TPML_PCR_SELECTION only allows 2 pcr sellections, may need to be refactored but I didn't want to blow that part of the codebase up

* fix TPM2_SetupPCRSel to correctly use hash type banks

* update policy functions and examples based on pr comments

fixed rsa keys not working due to null default signing algorithm, seal_policy_auth can now be called with no arguments and will pick defaults

* update policy examples based on pcr comments

added error codes and htons macro for use when wolfcrypt is not available

* added policySigned logic to policy seal with nv functions

currently the policy seal with auth nv example is broken due to strange session issues

* Improvements to the session authentication for policy sessions.

* update the sealNV functions, add PolicyRestart and manual htnos

wolfTPM2_SealWithAuthSigNV allows for sealing secrets to NV with just the public part of the sealing key and a pre signed signature so that the private part of the key can be kept off the system. PolicyRestart was added to make reseting the policyDigest easy and a manual htnos function was added for use in wolfBoot

* update policy code based on pr comments

* reconfigure wolfTPM after setting up ibm simulator

* define XREWIND in wolfTPM since it is no longer in wolfssl

* fix scan-build warnings

* remove RSA_SIG_SZ

* use signed char in HexCharToByte for strict build options

* update based on pr comments

---------

Co-authored-by: David Garske <david@wolfssl.com>
2023-04-13 11:24:37 -07:00
David Garske 219038639a
Merge pull request #266 from jpbland1/evict-control-example-fix
fix broken evict control example
2023-04-13 08:26:13 -07:00
John Bland c8fd9c6359 fix broken evict control example
evict control had an issue where the default noauth session was being used
alongisde the encrypted section. to fix this wolfTPM2_SetAuthSession needs
to be called with index 0 to override the default session, it's possible we've
made this mistake in many places
2023-04-13 01:13:04 -04:00
David Garske af0668eafd Fix for building with wolfTPM without wolfCrypt `--disable-wolfcrypt`. Added test. 2023-04-12 15:07:46 -07:00
David Garske f2a95f3902 Fix for Microchip Harmony build settings. Rename to `WOLFTPM_MICROCHIP_HARMONY`. Avoids confusion with the TPM 2.0 module ATTPM from Microchip. Now enabled with `WOLFTPM_MICROCHIP` and provides backwards compatibility for `WOLFTPM_MCHP`. The new `WOLFTPM_MICROCHIP` has not been released (was added in PR #251). 2023-02-03 10:49:29 -08:00
John Bland 1825b6f457 add thread local storage macro and make gActiveTPM local to the thread 2023-01-16 15:36:45 -05:00
David Garske 41e5750ff2 Peer review fixes. Cleanups for return code checking, stdlib functions, unknown args and coding standards. 2022-10-04 13:19:51 -07:00
David Garske d491437e08 Use `strcmp` since `argv` is guaranteed to be NULL terminated. Fix keygen example whitespace alignment. 2022-10-04 11:44:16 -07:00
David Garske 94b59d5255 wolfTPM v2.6.0
* Fix CMakeList.txt to fix include order.
* Remove execute bit on code files.
2022-09-01 10:41:42 -07:00
David Garske 042f4c51aa Simplified fix for CSharp `SetCustomExtension`. 2022-08-26 10:52:31 -07:00
Anthony Hu ccee50355d Changes from peer review feedback. 2022-08-26 09:57:13 -04:00
David Garske 3f84b2efbc wolfTPM v2.5.0 release prep 2022-07-22 09:32:57 -07:00
David Garske d9b664b719 Improve the byte swapping logic for GCC. 2022-07-20 10:30:33 -07:00
David Garske 2ce8062f06 Fix for Infineon SLB9672 max speed. For older SLB9670 use `--enable-infineon=slb9670` or define `WOLFTPM_SLB9670`. Fixes #223 2022-07-15 15:52:37 -07:00
David Garske 9d2483d327 New CSR wrappers to assist with TPM based CSR/Self-Signed-Cert generation including CSharp wrappers. This includes support for subject, key usage, custom request extensions and output as PEM or DER. New structure `WOLFTPM2_CSR`. New API's `wolfTPM2_CSR_*`. New CSharp class `Csr`. 2022-07-12 13:53:04 -07:00
David Garske a22277a07d Infineon SLB9672 support. 2022-06-28 16:07:30 -07:00
Elms 6324ed6253 New API fixes (added for c# wrappers)
- define `XMALLOC` and `XFREE` defaults when `WOLFTPM2_NO_WOLFCRYPT` is set
- Add docstrings
2022-05-06 21:17:36 -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 d035cd239c Fix for a few spelling errors. Whitespace cleanup. 2021-12-07 11:10:50 -08:00
David Garske 7b155b5549 Fix for big endian in TIS layer. 2021-10-29 13:52:12 -07:00
elms 22167f24ff Fixes for Windows buids without wolfcrypt and other tools 2021-07-21 15:56:27 -07:00