tpm: Use new ptm_cap_n structure for PTM_GET_CAPABILITY
authorStefan Berger <stefanb@linux.ibm.com>
Wed, 16 Oct 2024 17:51:28 +0000 (13:51 -0400)
committerStefan Berger <stefanb@linux.ibm.com>
Fri, 18 Oct 2024 11:53:11 +0000 (07:53 -0400)
commit312c5404011f6a80d1467a19abd916fd203dd7d4
tree31fda66eaabf017ab1747b1a9436e318c98419c5
parent95a16ee753d6da651fce8df876333bf7fcf134d9
tpm: Use new ptm_cap_n structure for PTM_GET_CAPABILITY

Use the new ptm_cap_n structure for getting the PTM_GET_CAPABILITY response
from swtpm. Previously only 17 bits could possibly have been set in ptm_cap
(uint64_t) in big endian order and those bits are now found in the 2nd
32bit word in the response in the caps field.

This data structure makes it now clear that the 1st 32bit word carries the
tpm_result like all the other response structures of all other commands
do.

The changes are taken from the swtpm project's tpm_ioctl.h.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
backends/tpm/tpm_emulator.c
backends/tpm/tpm_ioctl.h
backends/tpm/trace-events