David Garske
626beaf4d7
Fixes for native_test with ST33 and `TPM2_GetRandom2`.
2024-03-20 15:23:44 -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
4c753683c2
Fix native test `TPM2_PolicyPCR`.
2023-12-29 09:21:44 -08:00
John Bland
ae280a7e71
fix casting and unused variable problems on windows ( #255 )
2023-01-27 14:34:02 -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
David Garske
3f84b2efbc
wolfTPM v2.5.0 release prep
2022-07-22 09:32:57 -07:00
Elms
fd1474c68b
cmake: Add to readme and fix native test
2022-04-07 10:55:15 -07:00
Elms
084ef170b7
cmake: windows fixes and spell fixes
...
* Examples working on Windows and SWTPM
* Check command availability (including for windows blocking it).
* update unseal to work without persistent NV storage
* cleanup cmake from review
* fix a few spelling mistakes
2022-04-07 10:55:11 -07:00
Elms
f2b7bec392
cmake: Initial cmake build
...
Includes fixes for windows builds using both msys and MSVC
2022-04-07 10:54:52 -07:00
David Garske
a2613bcae7
Fix for `TPM2_GetRandom2` to fallback to normal command if not found. Some older STM33 TPM firmware does not support this command. Fix to make sure we don't request more random data than the response can physically handle.
2022-02-04 09:51:09 -08:00
David Garske
4ced78d002
Added test for `TPM2_GetRandom2`
2022-02-04 09:28:03 -08:00
David Garske
0f9e8b5768
wolfTPM Release v2.3.0
2021-11-08 15:49:00 -08:00
Elms
02b8834244
test: Allow `CreateLoaded` to pass on unsupported systems
...
Some hardware may not support these, but allow native and wrap tests to pass with comment
2021-07-26 11:18:33 -07:00
David Garske
54d3fea42b
Fix for mismatch memset size.
2021-07-22 11:33:13 -07:00
Dimitar Tomov
8528a326be
Added fixes and unit tests for wolfTPM2_CreateLoadedKey and TPM2_CreateLoaded
...
* Added new units tests and fixed missing XMEMSET
* Renamed and modified PemToTpm to PubPemToTpm, works only with Pub keys
* Fixes from peer feedback
Signed-off-by: Dimitar Tomov <dimi@wolfssl.com>
2021-07-12 15:09:28 -07:00
Dimitar Tomov
21e6a74d8b
Added unit test for TPM2_CertifyCreation
...
In a real-life use case, signHandle and objectHandle would
point to different objects. For unit testing, signHandle and
objectHandle can be the same object, because wolfTPM performs
the TPM2_CertifyCreation command the same.
Signed-off-by: Dimitar Tomov <dimi@wolfssl.com>
2021-05-31 19:51:32 +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
Elms
d9360f035a
test: exit with 0 if test not supported by hardware
...
`native_test` attempts tests that may not be supported by hardware.
In these cases, warnings are printed, but the exectuable should still
return 0 for success.
2021-03-08 09:15:51 -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
75db91c003
Updates to demonstrate using parameter encryption with the native test. Allow NULL key for the HmacSetKey (for unsalted / unbound).
2020-12-01 16:00:47 -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
0e4c6672fd
TPM Parameter Encryption with AES CFB or XOR is fully working. Tested keygen, keyload, keyimport and PCR quote with parameter encryption using both ciphers. This commit includes a refactor of the auth command structure to adhere to TPM spec. Includes optimization for AES CFB and XOR to do done inline. For for the decryption nonce to use the newer for U in KDFa.
2020-11-25 13:00:42 -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
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
6d46b26bde
Added dynamic module detection at run-time when using internal TIS.
2020-07-13 09:55:36 -07:00
Dimitar Tomov
1f7e612ba1
Add TPM2 native API test for ReadClock
...
Signed-off-by: Dimitar Tomov <dimi@designfirst.ee>
2020-05-26 17:05:23 +03:00
Dimitar Tomov
90d47ae5a3
Add TPM2 native API test for TPM2_PCR_Reset
...
Signed-off-by: Dimitar Tomov <dimi@designfirst.ee>
2020-05-13 15:53:43 +03:00
Chris Conlon
91ef0b0e6e
update copyright to 2020
2020-01-03 15:31:27 -08:00
David Garske
7887130287
wolfTPM v1.7 Release
2019-12-27 14:43:30 -08:00
David Garske
4de58e6d60
Remove execute bit on .c/.h files.
2019-05-14 13:58:06 -07:00
David Garske
74e561f825
TPM improvements and fixes for testing hardware. Optimization to init mutex and rng on use only.
2019-05-08 11:41:09 -07:00
David Garske
5f0c7ba6c1
Fix printf type warnings. Added missing stdio.h for printf in examples. Added new API's `TPM2_SetActiveCtx`, `TPM2_ChipStartup`, `TPM2_SetHalIoCb` and `TPM2_Init_ex`. Fix to make sure TPM2_CTX is cleaned up after `wolfTPM2_Test`. Allowed way to indicate `BOOL` type already defined.
2019-05-07 14:35:23 -07:00
David Garske
70b354677e
Implemented workaround for TPM2_EncryptDecrypt. Improved ATTPM20 workarounds for backwards compatibility. Added README.md notes for ATTPM20.
2019-02-01 11:01:40 -08:00
David Garske
6090e4bff6
Implemented workarounds for known ATTPM20 issues. Changes the default algo for PCR read to SHA1. Clear the sign obj attrib on symmetric key creation template (both sign and decrypt cannot be set at same time).
2019-02-01 10:28:11 -08:00
David Garske
dc441a1555
New support for mchp `--enable-mchp`.
2019-01-30 13:41:05 -08:00
David Garske
d28e63c72f
Added TPM2 wrappers for symmetric AES encrypt and decrypt. Moved common test parameters into examples/tpm_test.h.
2018-12-28 12:15:58 -08:00
David Garske
037c3a2d59
Added ECDH support for ephemeral key generation and shared secret. Adds new wrapper API's `wolfTPM2_ECDHGenKey` and `wolfTPM2_ECDHGenZ`. Added crypto dev (TLS client/server) support for ECDH using TPM. Added ECDH tests in native and wrapper. Added experimental support for the 2-phase ephemeral key support with new wrapper API's `wolfTPM2_ECDHEGenKey` and `wolfTPM2_ECDHEGenZ`.
2018-11-16 13:27:22 -08:00
Eric Blankenhorn
5f2a59179f
Read firmware example
2018-10-26 15:20:03 -05:00
David Garske
95a978c37b
Added new RNG wrapper API `wolfTPM2_GetRandom`. Added macro for hardware RNG max request as `MAX_RNG_REQ_SIZE`. Trailing whitespace cleanup.
2018-09-20 12:15:03 -07:00
David Garske
0cfe8dd789
Decoupled the fixed algorithms sizes and build options from wolfCrypt. Now wolfCrypt can be built with algos like SHA256 and AES disabled, but they can still be supported in wolfTPM. Updated the README.md with a few additional build details.
2018-09-13 18:41:03 -07:00
David Garske
a7f370db2d
Added instructions for enabling I2C on the Raspberry Pi. Fix bug with native example where TPM2_Shutdown failure would loop.
2018-09-07 15:51:12 -07:00
David Garske
ba48628948
Improved error handling for the case where `TPM2_EncryptDecrypt2` is not supported. Added wrapper to help with creation of symmetric keys `wolfTPM2_GetKeyTemplate_Symmetric`.
2018-08-28 09:09:10 -07:00
David Garske
ae57221b4e
Improved handling for command code not supported TPM_RC_COMMAND_CODE on TPM2_EncryptDecrypt2 calls.
2018-08-27 14:31:40 -07:00
David Garske
91c4feff2b
Completed adding support for symetric AES encrypt/decrypt support. Works on ST33 only. The command is off by default. ST provided details for enabling this command using a vendor sepecific command.
2018-08-27 14:09:34 -07:00
David Garske
765d825dee
Improvements to the Native tests. Adding support for `TPM2_EncryptDecrypt2` in native test. Appears to be an unsupported command on the SLB 9670. AES Key creation does work.
2018-08-27 14:09:34 -07:00
David Garske
6fe075911a
* Added advanced IO callback support (enabled using `--enable-advio` or `#define WOLFTPM_ADV_IO`).
...
* Added ST33 TPM 2.0 support (`--enable-st33` or `#define WOLFTPM_ST33`). Only SPI version is tested and verified.
* Experimental TIS I2C support (`--enable-i2c` or `#define WOLFTPM_I2C`).
* Cleanup of the IO callback examples.
* Added support for Atmel ASF SPI.
2018-08-22 16:40:33 -07:00
David Garske
d8174d4ef7
Added build option to disable wolfCrypt dependency using `./configure --disable-wolfcrypt` or `#define WOLFTPM2_NO_WOLFCRYPT`. Moved types and configuration/port specific items into new `tpm2_types.h`. Removed execute bit on serveral files.
2018-08-12 15:25:35 -07:00
David Garske
3e462b0172
Added TPM bechmarking support.
2018-05-25 11:59:55 -07:00
Jacob Barthelmeh
f9f1c24641
static analysis warnings
2018-05-22 10:45:17 -06:00
David Garske
bf725524de
Removed the execute bit on new files.
2018-05-21 23:07:26 +00:00