Commit Graph

35 Commits (a19ac0d19c79f3f7b0fb9ef0169ddddd1fb0d33b)

Author SHA1 Message Date
David Garske 6fbb49a94f wolfTPM Release v3.9.0. Updated copyright and version. 2025-05-14 15:31:07 -07:00
David Garske 87edf3d840 Cleanup the `SensitiveToPrivate` function stack variables. Switch `wolfTPM2_LoadSymmetricKey` to default to the `WOLFTPM2_WRAP_DIGEST` for hash algorithm and not try to use SHA1. Cleanup comments on EK/SRK. Tab and formatting. 2024-12-06 16:56:03 -08:00
David Garske 3617abca97 Fix warning: `cannot convert argument of incomplete type 'void *' to 'WOLFTPM2_KEY *'`. Fix `extend.c:158:9: warning: Value stored to 'rc' is never read`. Fix `src/tpm2_wrap.c:2193:5: warning: Value stored to 'sensSz' is never read`. 2024-11-05 11:34:54 -08: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 0aa01f4f5a Added PKCS7 ECC support to example. Added wrapper function to export TPM public key as DER/ASN.1 or PEM. Fix for crypto callback ECC sign to handle getting keySz for unknown cases (like PKCS7 without privateKey set). 2024-01-17 15:50:30 -08:00
David Garske 8968d89f90 More CI fixes. 2023-08-31 12:29:13 -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 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 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 3f84b2efbc wolfTPM v2.5.0 release prep 2022-07-22 09:32:57 -07:00
David Garske b40574f545 Fix for keyload broken with PR 174. Added GPIO note about no input support for Nuvoton. 2021-07-13 16:06:33 -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
Dimitar Tomov 58c8053feb Changes for running seal example without wolfcrypt support
When wolfcrypt is not enabled:
* examples/keygen/keyload failed without error message
* examples/seal/seal did not generate an error message
* examples/seal/unseal was missing conditional compiling
Now, this is fixed.

Signed-off-by: Dimitar Tomov <dimi@wolfssl.com>
2021-04-20 15:33:08 +03:00
Dimitar Tomov a45a398850 Added option for persistent key to examples/keygen/keyload
Signed-off-by: Dimitar Tomov <dimi@wolfssl.com>
2021-04-16 10:41:01 +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
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 4c2e8d3f43 Added response HMAC validation. Fixes for nonce and auth count. Fix for AES CFB decrypt set key (requires `AES_ENCRYPTION` on SetKey). Cleanup verbose debugging. PR ready for review. 2020-11-25 16:04:04 -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
Elms 951e27f706 examples: cleanup for mingw coexistence 2020-11-13 14:38:19 -08:00
Elms 3ce0a6871c Rebase and leverage new API with KEYBLOB 2020-11-12 14:08:13 -08:00
David Garske a3baa279a9 Fix for `set but not used` with `--disable-wolfcrypt`. 2020-11-12 13:38:22 -08:00
David Garske fdc149854e Fix build issues with `--disable-wolfcrypt`. 2020-11-12 13:28:50 -08:00
Dimitar Tomov 1a24bab50f Minor fixes for keyload usage, examples README and whitespaces
Signed-off-by: Dimitar Tomov <dimi@designfirst.ee>
2020-11-12 16:18:03 +02:00
David Garske 4ce00ecb26 Added usage and fixed key import API name 2020-11-06 16:08:19 -08:00
David Garske 961710de63 Added support for importing external private key to get a key blob for easy re-loading. 2020-11-02 14:23:47 -08:00
David Garske 72e2b73278 Return error code if file not found on key load. 2020-10-27 15:33:58 -07:00
David Garske 6b61e85496 Improved the key blob storage. Added ECC support to keygen example. 2020-10-27 10:16:33 -07:00
David Garske 21daf5a21c Key generation and loading examples using disk to store the key. Leverage wolfSSL filesystem abstraction. 2020-10-26 15:49:51 -07:00