Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tss2-tcti: tcti-libtpms: fix test failure on big-endian platform #2675

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/tss2-tcti/tcti-libtpms.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ tcti_libtpms_transmit(
tpm_header_t header;
TSS2_RC rc;
TPM_RESULT ret;
uint32_t resp_size;
uint32_t respbufsize;

rc = tcti_common_transmit_checks(tcti_common, cmd_buf, TCTI_LIBTPMS_MAGIC);
if (rc != TSS2_RC_SUCCESS) {
Expand All @@ -386,11 +388,16 @@ tcti_libtpms_transmit(
}

LOGBLOB_DEBUG(cmd_buf, size, "Sending command with TPM_CC 0x%" PRIx32, header.size);
resp_size = (uint32_t) tcti_libtpms->response_len;
respbufsize = (uint32_t) tcti_libtpms->response_buffer_len;
LIBTPMS_API_CALL(fail, tcti_libtpms, TPMLIB_Process, &tcti_libtpms->response_buffer,
(uint32_t *) &tcti_libtpms->response_len,
(uint32_t *) &tcti_libtpms->response_buffer_len,
(uint32_t *) &resp_size,
(uint32_t *) &respbufsize,
(uint8_t *) cmd_buf,
size);
tcti_libtpms->response_len = resp_size;
tcti_libtpms->response_buffer_len = respbufsize;

rc = tcti_libtpms_store_state(tcti_libtpms);
if (rc != TSS2_RC_SUCCESS) {
LOG_ERROR("Failed to store state file");
Expand Down