Commit Graph

34 Commits (6fbb49a94f2ba4048b69d03ea3d2add02e2a7543)

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 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 034306a49c Fix macros to match. Resolves `error: unused variable 'pubKeySz'` and `examples/pcr/quote.c:336:9: error: use of undeclared identifier 'pubKey'`. 2024-09-20 17:15:08 -07:00
JacobBarthelmeh 388e32912e use XMALLOC/XFREE and update macro guards 2024-09-20 10:02:45 -07:00
JacobBarthelmeh a3beae82ee re-create correct hash before verify attempt 2024-09-13 14:53:56 -06:00
JacobBarthelmeh 4115da0b96 add example manual verification of quote signature with ecc 2024-09-13 12:09:53 -06: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 8968d89f90 More CI fixes. 2023-08-31 12:29:13 -07: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 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 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
Dimitar Tomov 4f6e35f7fd Minor change for attestation examples, EK is not needed
* EK is not needed for Quote or GetTime
* Only Endorsement Hierarchy is needed for GetTime

Signed-off-by: Dimitar Tomov <dimi@wolfssl.com>
2021-03-12 23:47:12 +02: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 d044360e38 Fixes for scan-build and g++ warnings. 2020-12-01 10:38:39 -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 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 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 029fafdf87 Remove execute bit on source files. 2020-09-02 11:46:12 -07:00
Eric Blankenhorn 72464dc621 Release v1.9 preparation 2020-08-24 12:12:11 -05:00
Dimitar Tomov 6f822d62f5 Cleanups, removed unused code from the PCR examples
* Policy session is not used for PCR extend and reset
* Policy session is not required for generating a Quote using AIK under SRK

Signed-off-by: Dimitar Tomov <dimi@designfirst.ee>
2020-07-31 22:22:39 +03:00
David Garske b78e93f9ca Documentation and code cleanups. Enhanced pcr/quote example to use the existing SRK. Added "-?" help usage on PCR examples. Switched to atoi. Fixed .am issue in TLS example cause make dist to break. Added include of new files for make dist. 2020-07-23 09:46:06 -07:00
Dimitar Tomov 15661724d9 Change the level of debug prints for pcr examples to be normal
Signed-off-by: Dimitar Tomov <dimi@designfirst.ee>
2020-07-23 15:06:14 +03:00
Dimitar Tomov be3f9b7385 Cleanups based on peer review. Updated gitignore.
Signed-off-by: Dimitar Tomov <dimi@designfirst.ee>
2020-07-22 00:17:50 +03:00
Dimitar Tomov 70d2f4a9b3 Quickfix for missing header when building with NO_WOLFCRYPT
Signed-off-by: Dimitar Tomov <dimi@designfirst.ee>
2020-07-21 16:42:00 +03:00
Dimitar Tomov 4b33d75fcc Quick fix for when bad arguments are passed to examples
Otherwise, TPM2_Cleanup() generated an error in TPM2_Shutdown,
because TPM2_DEV passed the NULL check, but was not initalized.
Since TPM2_DEV was not still open.

Signed-off-by: Dimitar Tomov <dimi@designfirst.ee>
2020-07-20 15:34:24 +03:00
Dimitar Tomov 16088ac6be Modify quote example to support parameters for PCR and file output
Signed-off-by: Dimitar Tomov <dimi@designfirst.ee>
2020-07-19 19:31:19 +03:00
Dimitar Tomov 08cd7a0836 Add debug prints to the TPM2 Quote example plus changes from peer review
Signed-off-by: Dimitar Tomov <dimi@designfirst.ee>
2020-07-17 18:10:43 +03:00
Dimitar Tomov c4339fbb5a Add example of generating a TPM2.0 Quote using wolfTPM
Signed-off-by: Dimitar Tomov <dimi@designfirst.ee>
2020-07-16 17:09:46 +03:00