mirror of
https://github.com/stefanberger/libtpms
synced 2025-12-30 18:31:53 +00:00
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> |
||
|---|---|---|
| .. | ||
| tpm2 | ||
| tpm12 | ||
| compiler.h | ||
| libtpms.syms | ||
| Makefile.am | ||
| test.syms | ||
| tpm_library_conf.h | ||
| tpm_library_intern.h | ||
| tpm_library.c | ||
| tpm_tpm2_interface.c | ||
| tpm_tpm2_tis.c | ||
| tpm_tpm12_interface.c | ||
| tpm_tpm12_tis.c | ||