21 Commits

Author SHA1 Message Date
Peter Huewe
3d55476179 cppcheck: Fix Shifting signed 32-bit value by 31 bits is implementation-defined behaviour
cppcheck emits a warning:
`Shifting signed 32-bit value by 31 bits is implementation-defined behaviour`, which is correct.

=> Add U suffix to constant to fix the issue

Signed-off-by: Peter Huewe <Peter.Huewe@infineon.com>
2022-06-08 09:22:17 +08:00
wenxin.leong
67d0978779 Add support for SHA-384 and PCR Allocate
SHA-384 is now supported in:
- Hash sequence (-a/-A)
- Hash (-s/-S)
- PCR extend (-e/-E)
- PCR read (-r/-R)

New command line option (-l) to support PCR allocation for SHA-1/256/384 bank.
2022-06-02 09:15:02 +02:00
wenxin.leong
3dd13d39ca Add optional parameter for setting hash algorithm
Add a new optional parameter (e.g., 'sha1', 'sha256') to set the hash algorithm for option '-a', '-e', '-r', and '-s'. If the parameter is not present, default value is SHA-1.
2022-06-02 09:15:02 +02:00
Peter Huewe
ec518c5e04 Improve help message for Get Random
The previous help message for Get Random indicated that the user can enter a value of 32 for 0x32 (=50 bytes) .
However the maximum supported number of bytes is 0x20 = 32 bytes.
This patch improves the help message to reflect this maximum.
Reported by @zveriu in issue #11.
Signed-off-by: Peter Huewe <peter.huewe@infineon.com>
2018-05-08 10:32:32 +02:00
Peter Huewe
db61889621 Fix whitespace/indention to make code more readable
For some reason the indention and whitespaces were quite messed up.
This patchset fixes this and makes the code much more readable

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
2018-03-22 23:29:33 +01:00
Peter Huewe
b01a7f2786 Use architecture independent format specifiers.
On 64bit machines the compilation yielded some warnings due to incorrect
format specifiers. Use the standard one from inttypes.h.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
2018-03-22 23:29:33 +01:00
Peter Huewe
b465094f23 Fix and improve TPM2_GetCapability Flag handling
Instead of using pre-defined offsets within the response buffer,
this patch now uses the property tags to match the flags.
This is less error prone in case some structures get added to the
response of TPM2_GetCapability.

Tested with SLB9670 FW Version 7.40.2098.0 on Raspberry Pi 3

Signed-off-by: Peter Huewe <peter.huewe@infineon.com>
2018-03-12 17:58:00 +00:00
Thomas
fb49692046 replace tabs of parameter explanation comments of functions with spaces 2017-09-11 14:52:13 +02:00
Thomas
81b03fef5a replace tabs of parameter explanation comments of functions with spaces 2017-09-11 14:50:46 +02:00
Thomas
ded6b58ba1 replace tabs of parameter explanation comments of functions with spaces 2017-09-11 14:47:56 +02:00
Thomas
2b4fad42d4 edit parameter description of eltt2.c to align second column 2017-09-11 14:38:10 +02:00
Thomas
767e322105 edit parameter description of eltt2.c to align second column in line 32 2017-09-11 14:36:42 +02:00
Thomas
a6d0996f0c edit parameter description of eltt2.c 2017-09-11 14:33:43 +02:00
Thomas
b677fc9ecf edit header description of eltt2.c 2017-09-11 14:30:56 +02:00
Thomas
5bf0910e5a change bit selection in print_capability_flags 2017-09-11 14:05:34 +02:00
Furtner Thomas (IFAG CCS M CS AE)
e857919d34 update 2017-07-20 12:52:14 +02:00
Thomas Furtner
c248520926 Update eltt2.c 2017-06-23 08:46:20 +02:00
thomas
758a41f16d edit README file to show new command line option
edit eltt2.c to show new option in help menu
2017-04-16 21:16:42 +02:00
thomas
785d85fbc1 remove Startup Clear print from -g option 2017-04-16 20:56:35 +02:00
thomas
31fc059693 add -v option to print variable TPM capabilites 2017-04-16 20:41:12 +02:00
Thomas Furtner
3e716caac2 Add files via upload 2017-04-07 08:11:32 +02:00