libtpms/src
Stefan Berger be5fabf155 tpm2: Consume padding bytes in TPM2_ContextLoad() (Win2k19, issue #217)
Windows 2019 Server padds the TPM_ContextLoad() command with additional
bytes up to TPM_PT_MAX_OBJECT_CONTEXT for the TPMS_CONTEXT part. Since
libtpms does not use an OBJECT to serialize the keys (anymore) it now
uses less bytes than the MAXimum of TPM_PT_MAX_OBJECT_CONTEXT bytes and
the padding leaves some unconsumed bytes that end up failing the command
since no left-over bytes are allowed in any command.

When unconsumed bytes are left in TPMS_CONTEXT_Unmarshal() we check that
the original passed in size was that of TPM_PT_MAX_OBJECT_CONTEXT and
only then consume the additional padding bytes. Luckily only one command
calls TPMS_CONTEXT_Unmarshal() so that no unwanted side effects should
occur anywhere else, such as no bytes left for unmarshalling the next
structure.

The wisdom behind the padding is not quite clear but it feels like
ill-fixing the code to work around a Windows 2019 server bug...

This patch fixes issed #217

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-06-01 06:39:35 -04:00
..
tpm2 tpm2: Consume padding bytes in TPM2_ContextLoad() (Win2k19, issue #217) 2021-06-01 06:39:35 -04:00
tpm12 Fix many misspellings 2021-03-02 08:20:25 -05:00
compiler.h library: use __attribute__((format,...) to check printf format and args 2018-06-15 18:07:49 -04:00
libtpms.syms Integrate the TPM 2 into the library; do not compile with TPM 2 yet 2018-06-15 18:07:47 -04:00
Makefile.am build-sys: leave CFLAGS/LDFLAGS for user to be defined 2021-05-18 12:21:31 -04:00
test.syms build-sys: work around broken linker when testing --version-script support 2018-08-30 21:45:16 +00:00
tpm_library_conf.h Fix many misspellings 2021-03-02 08:20:25 -05:00
tpm_library_intern.h tpm2: Log command that put TPM 2 into failure mode 2018-12-10 09:17:25 -05:00
tpm_library.c [build-sys] Add -Wmissing-prototypes to CFLAGS and clean up 2020-06-01 18:23:07 -04:00
tpm_tpm2_interface.c tpm2: Implement a cache for the private exponent D and prime Q 2021-03-23 15:39:27 -04:00
tpm_tpm2_tis.c tpm2: rev155: Major refactoring of header files 2020-04-14 16:03:45 -04:00
tpm_tpm12_interface.c [build-sys] Add -Wmissing-prototypes to CFLAGS and clean up 2020-06-01 18:23:07 -04:00
tpm_tpm12_tis.c Introduce internal interface to reach TPM functionality 2015-12-08 09:07:54 -05:00