Commit Graph

246 Commits (2e72da7d7521cf741b427e9ca7405f73ee9ceb97)

Author SHA1 Message Date
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
David Garske ab9bf2981b Fixes for MMIO HAL refactor. 2023-06-28 16:00:56 -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 f8c1ff6075 tis: support memory mapped tpm 2023-05-30 16:58:46 +00:00
Marco Oliverio d0beda2d71 types.h: add typedef for address sized integer 2023-05-30 16:58:12 +00: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 fb5d43d912
Merge pull request #258 from jpbland1/typo-fix
fix rsa key import function signature comments
2023-04-26 07:56:03 -07:00
John Bland 6678ea7c4b add external nvram policy sealing example, fix wolfTPM2_SealWithAuthSigNV
wolfTPM2_SealWithAuthSigNV needs to have PolicyPCR called as a part of its logic since it uses wolfTPM2_SetAuthPassword, which interferes with the policy digest
2023-04-17 18:29:18 -04:00
John Bland 75e373c80a
add wolfTPM2_GetKeyBlobAsSeparateBuffers (#265)
* add wolfTPM2_GetKeyBlobAsSeparateBuffers
* fix verbose logging problem
2023-04-13 11:25:56 -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 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
John Bland ac542f6f7c fix rsa key import function signature comments 2023-02-13 12:25:24 -05:00
John Bland 48ba4b6eef fix the TPM_E_COMMAND_BLOCKED macro to have the correct value according to the microsoft documentation 2023-02-10 10:49:44 -05: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 ae280a7e71
fix casting and unused variable problems on windows (#255) 2023-01-27 14:34:02 -08:00
John Bland 3a1ece8da1
Add RSA key import methods to handle PEM and DER encoding directly (#252) 2023-01-27 14:17:19 -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
John Bland 883fc1c16a
Merge pull request #254 from dgarske/wolfcrypt_only
Fix for using type not available with wolfCrypt only
2023-01-18 14:09:56 -05: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 25dd0d46c0 Fix for using type not available with wolfCrypt only. 2023-01-12 16:59:25 -08:00
David Garske 4160930b48 wolfTPM v2.7.0 release prep. 2022-12-27 16:14:59 -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 fac51233c3 Added example for NV counter increment. Fixes for NV auth handling. 2022-10-04 13:09:05 -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
Anthony Hu fde458152f Save OIDs to a persistent buffer. 2022-08-25 16:23:19 -04:00
David Garske cf89cc42a7 Documentation fixes. 2022-08-01 10:57:31 -07:00
David Garske 54a53c03b6 Added more CSharp wrapper inline documentation. Fixed doxy error on `wolfTPM2_GetKeyBlobAsBuffer`. 2022-07-27 10:03:22 -07: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
Eric Blankenhorn baae8ee523
Merge pull request #214 from dgarske/slb9672
Infineon SLB9672 support
2022-07-01 11:24:23 -05:00
David Garske 44996b03ba Peer review fixes. 2022-07-01 08:50:50 -07:00
David Garske b3757892db Fixes for nonce from TPM hardware (when using no wolfCrypt RNG `WOLFTPM2_USE_HW_RNG`). 2022-06-29 19:15:56 -07:00
David Garske f0c2f02a20 Peer review cleanups. 2022-06-29 14:40:39 -07:00
David Garske f3610b0a11 CSharp wrapper support for setting unique with test case. 2022-06-28 17:07:32 -07:00
David Garske b41a14689f Add create primary key example. Add support for using a unique template with create and create primary. 2022-06-28 16:40:46 -07:00
David Garske a22277a07d Infineon SLB9672 support. 2022-06-28 16:07:30 -07:00
Anthony Hu 2c41a935d1
Merge pull request #212 from dgarske/csharp_add2
Adds CSharp wrapper tests for authenticated sessions
2022-06-27 13:43:00 -04:00
David Garske c7b28c1445 TPM support for using the public key with TLS. 2022-06-24 16:21:47 -07:00
David Garske 158ce0dbe0 Adds CSharp wrapper tests for authenticated sessions. Fixes issue with C# handle unloading. 2022-06-24 12:55:37 -07:00
David Garske 0ce7038863 Add `wolfTPM2_SetAuthSession` and `wolfTPM2_NVStoreKey`. 2022-05-23 13:51:28 -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 ed70aeb703 v2.4.0 release preparation 2022-05-06 10:52:41 -07:00