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>
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.
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.
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>
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>
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>
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>