Commit Graph

1036 Commits (1fa15951eb91a8fe89b3326077b9be6fb105edeb)

Author SHA1 Message Date
David Garske e646c5701e Peer review fixes. Avoid using a struct for the seed. 2023-07-20 12:28:39 -07:00
David Garske 7fcbcab634 Fixes for edge case builds !HAVE_ECC or NO_RSA. 2023-07-20 09:29:45 -07:00
David Garske 699217bc78
Merge pull request #280 from JacobBarthelmeh/cmake
update for cmake after wolfssl added NAMESPACE
2023-07-19 13:49:19 -07:00
David Garske ae6bac26c5 Added documentation and tests. 2023-07-19 13:28:50 -07: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
JacobBarthelmeh 64bdfbdfd9 update for cmake after wolfssl added NAMESPACE 2023-07-18 12:46:19 -07:00
John Bland 48775d49d0
Merge pull request #279 from dgarske/autoconf
Fixes for autoconf clean generation
2023-07-10 18:30:00 -04:00
David Garske 2e72da7d75 Fixes for autoconf to have a clean `./autogen.sh`. 2023-07-10 14:45:14 -07:00
Zackery 8ca55eae71
Merge pull request #277 from dgarske/fix_fio
Make sure the file IO XFEOF and XREWIND are available
2023-07-07 16:11:14 -06: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
John Bland e140a8b3d5
Merge pull request #275 from dgarske/zd16249
Fix for TPM2 create with decrypt or restricted flag set
2023-07-06 13:17:32 -04:00
David Garske c1909ce0ab Fix logic so fixedParent or (decrypt and restricted). 2023-07-05 15:52:09 -07:00
David Garske 4d21e5491e Fix for TPM2 create with decrypt or restricted flag set (must use symmetric algorithm). 2023-07-05 14:52:30 -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
David Garske 21638b065a Improve MMIO support to utilize the HAL framework. 2023-06-28 13:39:47 -07:00
David Garske e96d2ff052
Merge pull request #272 from jpbland1/enfoce-no-thread-ls
undefine HAVE_THREAD_LS if NO_THREAD_LS is defined
2023-06-02 12:26:42 -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 0cb092a4a9 tpm2: avoid use of sprintf
this allows to enable debug on sprintf-less systems.
2023-05-30 16:58:46 +00: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
John Bland a92732d82c
Add wc_SetSeed_Cb for fips ecc (#270) 2023-05-23 10:53:16 -07:00
John Bland cdff048597
Merge pull request #269 from dgarske/lowres
Fixes for low resource build options
2023-05-03 19:36:58 -04:00
John Bland d1cd4eff52 use correct session index for wrap test so parameter encryption works 2023-05-03 19:29:45 -04:00
David Garske 382ff91eb3 Support for disabling ASN.1 (--disable-asn) and still provide parameter encryption support. 2023-05-02 18:11:15 -07:00
David Garske 4242f2f6cf Fixes for building without ASN. Fix for ECC disabled with `WOLFSSL_PUBLIC_MP` set. 2023-05-02 17:27:48 -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 fb5d43d912
Merge pull request #258 from jpbland1/typo-fix
fix rsa key import function signature comments
2023-04-26 07:56:03 -07:00
David Garske 46631afecd
Merge pull request #268 from billphipps/fix-cs_change
Corrected Linux usage of cs_change, added config overrides.
2023-04-20 11:29:23 -07:00
Bill Phipps 928bf26dcc Style fixes. 2023-04-19 08:04:27 -07:00
Bill Phipps 36bbb57f67 Corrected defaults and autodetect. 2023-04-18 15:05:44 -07:00
Bill Phipps e95f2647d5 Updated HAL documentation for exposed values 2023-04-18 13:56:15 -07:00
Bill Phipps 052d8f5bc6 Corrected Linux usage of cs_change, added config overrides. 2023-04-18 13:18:33 -07:00
David Garske f032c5c569
Merge pull request #267 from jpbland1/policy-nv-update
add external nvram policy sealing example, fix wolfTPM2_SealWithAuthS…
2023-04-18 10:16:16 -07:00
John Bland 7a14f45355 update policy sealing code and documentation based on pr comments 2023-04-18 13:05:42 -04: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 01558aef0b
Merge pull request #264 from dgarske/nowolfcrypt
Fix for building with wolfTPM without wolfCrypt `--disable-wolfcrypt`
2023-04-13 11:20:43 -04: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 ee2f766554
Merge pull request #257 from jpbland1/command-blocked-fix
fix the TPM_E_COMMAND_BLOCKED macro to have the correct value
2023-02-14 09:59:08 -08:00
John Bland 21027ef1c1
GitHub swtpm action (#259)
* wolfTPM support for GitHub actions.
* add github workflow for swtpm, runs make test
* add native and wrap test to the github action

---------

Co-authored-by: David Garske <david@wolfssl.com>
2023-02-14 09:06:36 -08: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
John Bland 8181987325
Merge pull request #256 from dgarske/microchip_bench
Microchip macro names and Support for bench with MPLABX Harmony
2023-02-03 18:07:41 -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
David Garske 10ad0399c3 Support for TPM benchmarking with Microchip MPLABX (`WOLFTPM_MICROCHIP`) ZD 15350 2023-02-02 10:56:19 -08:00
John Bland ae280a7e71
fix casting and unused variable problems on windows (#255) 2023-01-27 14:34:02 -08:00