[SLOF] [PATCH 0/4] tcgbios: Use the proper hashes for the TPM 2 PCR banks

Stefan Berger stefanb at linux.ibm.com
Wed Jun 16 00:41:11 AEST 2021

This PR adds the implementations for sha{1, 384, 512} and makes use
of the hash implementation when extending the PCRs of the respective
banks rather than always using the sha256 and either truncating the
hash or zero-padding it to fit the hash for a PCR bank.

Another patch in this series converts the S_CTRM_VERSION string to ucs_2
format (following a long-term TCG contributor) commonly used for this

Test cases for the sha implementations are added in the last patch in
this series but do not need to be added to the git repo.


Stefan Berger (4):
  tcgbios: Change format of S_CRTM_VERSION string to ucs-2
  tcgbios: Add implementations for sha1, sha384, and sha512
  tcgbios: Use The proper sha function for each PCR bank
  Add testprograms

 lib/libtpm/Makefile            |   2 +-
 lib/libtpm/sha.c               | 241 ++++++++++++++++++++++++++
 lib/libtpm/{sha256.h => sha.h} |   9 +-
 lib/libtpm/sha256.c            |   4 +-
 lib/libtpm/sha512.c            | 305 +++++++++++++++++++++++++++++++++
 lib/libtpm/tcgbios.c           |  89 ++++++++--
 6 files changed, 625 insertions(+), 25 deletions(-)
 create mode 100644 lib/libtpm/sha.c
 rename lib/libtpm/{sha256.h => sha.h} (70%)
 create mode 100644 lib/libtpm/sha512.c


More information about the SLOF mailing list