* Added new build option for TPM provisioning (`--enable-provisioning` on by default).
* Added new `wolfTPM2_CreatePrimaryKey_ex` and `WOLFTPM2_PKEY` that supports returning creation ticket/hash.
* Added key templates for initial device (IDevID) and attestation keys (IAK).
* Extended `create_primary` example to support creation or IDevID and IAK.
* Added new policy hash helper API `wolfTPM2_PolicyHash`
* Switch handle/nvIndex string parsing to use `strtoul`.
ZD 18347
* Fix bug with NV name after first write (only appears when using HMAC session).
* Add new API `wolfTPM2_UnsetAuthSession` to unset auth index for a session and save off the nonce from the TPM. This allows auth to be unset/set again with the same session.
* Cleanup in the NV API's for unsetting of the auth to be handled by caller, not in API.
wolfTPM2_SealWithAuthSigNV needs to have PolicyPCR called as a part of its logic since it uses wolfTPM2_SetAuthPassword, which interferes with the policy digest
* 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>
* Updated copyright
* Fixed minor cast warning.
* Fixed minor scan-build warnings.
* Cleanup print public and fix possible print of uninitialized field.
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>
* Added examples/nvram/store for storing TPM key in NVRAM
* Added examples/nvram/read for extracting keys from the TPM's NVRAM
Signed-off-by: Dimitar Tomov <dimi@wolfssl.com>