Commit Graph

48 Commits (master)

Author SHA1 Message Date
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 0aa01f4f5a Added PKCS7 ECC support to example. Added wrapper function to export TPM public key as DER/ASN.1 or PEM. Fix for crypto callback ECC sign to handle getting keySz for unknown cases (like PKCS7 without privateKey set). 2024-01-17 15:50:30 -08:00
David Garske 53acf0bcbf Use localhost 127.0.0.1 for CSR. Add TLS server option `-self` to use the self signed certs. 2023-12-01 14:37:34 -08:00
David Garske e601803f1b Added support for PK callbacks with RSA Sign using PKCSv1.5 and PSS.
Fixes for building wolfTPM without crypto callbacks.
Fixes for building/running with FIPS.
2023-12-01 08:25:53 -08:00
David Garske 7a11cb2213 Fix support for ECC 384-bit only support. Tested with: `./configure --enable-wolftpm CFLAGS="-DECC_USER_CURVES -DNO_ECC256 -DHAVE_ECC384" --disable-examples --disable-crypttests && make` 2023-10-20 15:08:45 -07:00
David Garske 23a5d2595b Fixes for small stack. 2023-08-31 13:37:22 -07:00
David Garske 5b6c7c0368 Improvements to the secure_rot example. Add support for manually placing hash. 2023-08-15 14:41:09 -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 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 1ea4a591a8 HAL refactor and documentation improvements. Move example HAL implementations into new `hal` directory. Include the example HAL in the library when building. Updated HAL IO documentation. 2023-01-18 12:38:04 -08:00
David Garske 25dd0d46c0 Fix for using type not available with wolfCrypt only. 2023-01-12 16:59:25 -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 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
David Garske d035cd239c Fix for a few spelling errors. Whitespace cleanup. 2021-12-07 11:10:50 -08:00
Elms ede184c735 configure: keep example directory strcuture during install 2021-11-18 12:04:41 -08: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
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
David Garske c0fa6423d5 Cleanup of the examples to use the key templates. The PKCS7 example was failing because of a key mismatch between the TPM private key and the public key used in the certificate setup using the CSR and ./certs/certreq/sh`. 2021-01-14 16:41:12 -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 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
Dimitar Tomov 4b98d6d637 Fixed minor errors about missing header, variables not used and whitespaces
Signed-off-by: Dimitar Tomov <dimi@wolfssl.com>
2020-11-25 12:33:51 +02: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
Elms 3ce0a6871c Rebase and leverage new API with KEYBLOB 2020-11-12 14:08:13 -08:00
Elms 045800ccf5 examples: factor out common key setup steps 2020-11-12 14:04:00 -08:00
David Garske b1e130ae65 Update help for `--enable-cryptocb` (don't use old enable name). 2020-09-24 13:41:16 -07:00
David Garske ffa058e445 Fixes for building without wolfCrypt RSA (when `NO_RSA` is defined). 2020-04-22 10:37:50 -07: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 4b0ac61ef5 Added FIPS mode and Use Symmetric options. 2019-07-15 14:34:40 -07:00
David Garske 4de58e6d60 Remove execute bit on .c/.h files. 2019-05-14 13:58:06 -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 3e9d70c159 Fix to better handle chip detection. Added stdio printf include for TPM benchmark. Added C++ support. 2019-05-07 10:39:17 -07:00
David Garske a5d286c737 Fixes for various compiler warnings. Fixes for supporting new CryptoCb. Added way to implement own socket functions for TLS examples. Added TLS error codes. 2019-02-01 13:27:52 -08:00
David Garske e057bc0a35 Cleanup to ensure `TpmCryptoDevCtx tpmCtx` is memset. Added support for handling new cryptocb update. 2019-02-01 13:27:52 -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 d8b2ea6309 Added TLS server example for wolfTPM. Added `examples/README.md`. 2018-11-13 15:45:39 -08:00
David Garske 31d2605fe4 Changed the CSR example CertName to use designated initializers to resolve use against different wolfSSL versions. 2018-08-23 14:29:59 -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 c5a4c06dd1 Fixes for building with different wolfCrypt options. Fix for byte swap build error. 2018-08-15 11:53:14 -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 e367d63dad Fix for ECC sign/verify (fixes ECC crypto dev callback to handle ECC ASN1 encoding/decoding). Fix for CSR to have different CN's. Fix typo in `./certs/certreq.sh`. 2018-07-18 16:28:50 -07:00
David Garske 2e624e9cbc Fix for `wolfTPM2_LoadRsaPublicKey`, so loaded keys are allowed to do a public decrypt. Fixes for PKCS7 to use the signed CSR for the PKCS7 certificate, so the cert and key are the same. Cleanup of the PKCS7 example. 2018-07-18 16:28:50 -07:00
David Garske d489452d53 Updates to TPM based TLS Client example. Added CSR generation of an ECC Certificate. Added scripts to help with making certificates from the CSR. TLS still has some outstanding work for ECDHE. 2018-07-18 16:28:50 -07:00
David Garske f1e82ac0e4 Added PKCS7, CSR and TLS Client examples using the TPM. Added builtin wrapper support for `WOLF_CRYPT_DEV`, which enables wolfCrypt PK type callbacks for RSA and ECC. Moved some of the example configuration into `./examples/tpm_io.h`. TLS Client example is not complete. 2018-07-18 16:28:50 -07:00