Commit Graph

37 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
David Garske 1603cfdaaf More fixes for no filesystem. 2024-08-30 09:58:04 -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 c98ee9a71e Update copyright date. 2024-04-24 10:42:27 -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 6a32ed43ed Fix mixed variable declaration. 2024-01-09 13:19:31 -08:00
Eric Blankenhorn 233bd33240
Merge pull request #315 from dgarske/keyblob_tests
Added tests for keyblob buffer export/import and support for getting sizes
2023-12-08 15:10:04 -06:00
David Garske 65e03e15e6 Added Windows Visual Studio project for wolfTPM. 2023-12-06 15:10:44 -08:00
David Garske 53b043dafa Tests for keyblob buffer export/import. Added support for getting the keyblob sizes. 2023-12-06 11:20:18 -08:00
Tesfa Mael df89f497e5 Remove error-ssl.h 2023-11-01 17:17:28 -07:00
David Garske 1041898120 Compiler warning files with `NO_FILESYSTEM`. 2023-10-23 14:04:44 -07:00
David Garske 8968d89f90 More CI fixes. 2023-08-31 12:29:13 -07:00
David Garske a15260342f wolfTPM Support for sealing/unsealing based on a PCR that is signed externally. Use an external key to sign a PCR digest. Allows a new signed policy to be sent with updates to continue allowing a sealed secret to be unsealed when PCR's change. This resolves the issue with PCR brittleness. 2023-08-29 18:47:18 -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 649c257093 Improve SRK ECC support detection / handling. 2023-08-15 10:51:53 -07:00
David Garske 6126d04be3 Support for importing and loading public ECC/RSA keys formatted as PEM or DER. 2023-08-15 08:27:00 -07:00
David Garske 0ceeebeaf7 Fix for building with no PEM to DER. Fix for building with static library and no debug, due to missing stdio in examples. Fix for TLS examples missing WOLFCRYPT_ONLY check. Fix for building with WC_NO_RNG. Fix for RSA salt with RNG using crypto cb. 2023-05-02 16:18:21 -07:00
David Garske 3f84b2efbc wolfTPM v2.5.0 release prep 2022-07-22 09:32:57 -07:00
David Garske d035cd239c Fix for a few spelling errors. Whitespace cleanup. 2021-12-07 11:10:50 -08:00
David Garske 6ddcdb0763 Fixes for building with `--disable-wolfcrypt`. 2021-07-13 11:58:17 -07:00
Dimitar Tomov 3e217cc497 Made keygen and attestation examples work with EH keys
* Added option in keygen example to create and use keys under the EK
    - Added PolicySecret to provide EK auth

* Fix wrong total auth area size when multiple auth sessions are used
* Workaround policy Session for EK auth
* Added flag in WOLFTPM2_HANDLE to specify when policyAuth is used
* Added three macros to check TPM2.0 Policy session type

* Added option to use keys under Endorsement Hierarchy in attestation examples
    - MakeCredential modified to work without auth as TCG spec defines
    - MakeCredential can now use EK pub to encrypt challenge
    - AcivateCredential can now work with EK pub to decrypt challenge

* Added new wolfTPM2 wrapper for TPM2_CreateLoaded
    - Added missing TPM2_CreateLoaded command in tpm2.c
    - Create and load a key in single TPM 2.0 operation

* Added new wolfTPM2 wrappers to use PEM format in keygen
    - wolfTPM2_RsaKey_TpmToPem
    - wolfTPM2_RsaKey_PemToTpm

* Improved keygen, output in PEM format and saving EK's TPM2B_PUBLIC
    - Added keygen option to output PEM files for TPM public keys
    - Added saving of EK's TPM2B_PUBLIC for attestation purposes

* Modified keygen
    - Uses new wolfTPM2_CreateLoaded wrapper to acquire correct AK name
    - Stores AK name for attestation purposes

* Modified keyload to be able to load keys created under the EK/EH
    - Uses new wrapper
    - Can load keys created under EK/EH, non-AK and AK

* Added new wrapper for satisfying EK policy

* Applied fixes from peer review

Signed-off-by: Dimitar Tomov <dimi@wolfssl.com>
2021-07-12 15:09:28 -07: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
David Garske 8ee41a3c09 Fix minor printf type issue. 2021-03-15 15:11:31 -07:00
David Garske 3f7985b648 Fix for minor cast warning. 2021-03-12 15:15:30 -08:00
David Garske 197754b109 Minor cleanups. 2021-03-12 15:10:58 -08:00
Dimitar Tomov f0540d688e Make NVRAM and Keygen examples store the encoded public key part to save space
Before examples were always storing the maximum public key part size,
using sizeof(TPM2B_PUBLIC), with many empty fields. This meant, always
storing 616 bytes of public part, even if the public key part was less.

* writekeyBlob/readKeyBlob use the actual size of public key part
* NVRAM store/read use the actual size of the public key part
* Minor fixes from peer review
* Added comment to nvram/store about Host Endianness, per peer review
* Added public API for appending/parsing TPM2B_PUBLIC to byte streams

Signed-off-by: Dimitar Tomov <dimi@wolfssl.com>
2021-03-12 15:10:58 -08:00
Dimitar Tomov 228e8cfcec Minor fixes for NVRAM examples when wolfCrypt is disabled
Signed-off-by: Dimitar Tomov <dimi@wolfssl.com>
2021-03-01 22:45:27 +02:00
David Garske c0fa6423d5 Cleanup of the examples to use the key templates. The PKCS7 example was failing because of a key mismatch between the TPM private key and the public key used in the certificate setup using the CSR and ./certs/certreq/sh`. 2021-01-14 16:41:12 -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 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 5abeea75a9 Added object names to the command hash calculation (cpHash). Added HMAC key creation. Fixed outstanding TODO items. 2020-11-23 14:54:39 -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
David Garske 675f7deb22 Fixes for a couple minor build errors and warnings. Found using scan-build, CC=g++ and `NO_FILESYSTEM`. 2020-11-13 15:57:03 -08:00
Elms 951e27f706 examples: cleanup for mingw coexistence 2020-11-13 14:38:19 -08:00
Elms 0bff836fa2 examples: Cleanup TLS examples using keyblob 2020-11-13 11:31:01 -08:00
Elms 3ce0a6871c Rebase and leverage new API with KEYBLOB 2020-11-12 14:08:13 -08:00
Elms 045800ccf5 examples: factor out common key setup steps 2020-11-12 14:04:00 -08:00