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>
Remark-lint emits some warnings about the README.md:
- Warn when list item bullets are indented L31 + L32
- Warn for literal URLs in text L200
- Warn when shortcut reference links are used. L89 + L97
- Warn when references to undefined definitions are found L89 + L97
-> fix them, no visual changes.
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.
With TPM Spec Revision 1.38 new values were added for the fixed
capabilities, so the old limit of 0x2D elements is not sufficient
anymore. Increase it to the value of 101+1, so we get the
TPM_PT_PERMANENT flag in anycase.
Also updated two comments (see PR#14)
Signed-off-by: Peter Huewe <peter.huewe@infineon.com>
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>
Some implicit headerfiles were missing, if used without -std=gnu99.
Since we do not rely on gnu99 behavior by including the header files,
we can use -std=c99, which we state explicitly in the Makefile now.
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>