diff options
Diffstat (limited to 'firmware/lib/tpm_lite/tlcl.c')
-rw-r--r-- | firmware/lib/tpm_lite/tlcl.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/firmware/lib/tpm_lite/tlcl.c b/firmware/lib/tpm_lite/tlcl.c index 5c623b6f..fc820b55 100644 --- a/firmware/lib/tpm_lite/tlcl.c +++ b/firmware/lib/tpm_lite/tlcl.c @@ -50,6 +50,8 @@ static INLINE int TpmReturnCode(const uint8_t* buffer) { */ static uint32_t TlclSendReceiveNoRetry(const uint8_t* request, uint8_t* response, int max_length) { + + uint32_t response_length = max_length; uint32_t result; #ifdef EXTRA_LOGGING @@ -59,8 +61,8 @@ static uint32_t TlclSendReceiveNoRetry(const uint8_t* request, request[6], request[7], request[8], request[9])); #endif - result = TlclStubSendReceive(request, TpmCommandSize(request), - response, max_length); + result = VbExTpmSendReceive(request, TpmCommandSize(request), + response, &response_length); if (0 != result) { /* Communication with TPM failed, so response is garbage */ VBDEBUG(("TPM: command 0x%x send/receive failed: 0x%x\n", @@ -70,6 +72,10 @@ static uint32_t TlclSendReceiveNoRetry(const uint8_t* request, /* Otherwise, use the result code from the response */ result = TpmReturnCode(response); + /* TODO: add paranoia about returned response_length vs. max_length + * (and possibly expected length from the response header). See + * crosbug.com/17017 */ + #ifdef EXTRA_LOGGING VBDEBUG(("TPM: response: %x%x %x%x%x%x %x%x%x%x\n", response[0], response[1], @@ -127,7 +133,7 @@ static uint32_t Send(const uint8_t* command) { /* Exported functions. */ uint32_t TlclLibInit(void) { - return TlclStubInit(); + return VbExTpmInit(); } uint32_t TlclStartup(void) { |