From 32a6526d25d4bf9a1c137fc3d275d1c68935d184 Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Mon, 27 Jun 2011 10:49:11 -0700 Subject: Verified boot wrapper - add stub implementations for host This is part 2 of the wrapper API refactor. It adds stub implementations for the host, and changes the host-side utilities to use them. Firmware implementation is unchanged in this CL (other than a few updates to macros). BUG=chromium_os:16997 TEST=make && make runtests Change-Id: I63989bd11de1f2239ddae256beaccd31bfb5acef Reviewed-on: http://gerrit.chromium.org/gerrit/3256 Reviewed-by: Stefan Reinauer Tested-by: Randall Spangler --- firmware/lib/tpm_lite/tlcl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'firmware/lib/tpm_lite') diff --git a/firmware/lib/tpm_lite/tlcl.c b/firmware/lib/tpm_lite/tlcl.c index f36f4633..3fbcd1e7 100644 --- a/firmware/lib/tpm_lite/tlcl.c +++ b/firmware/lib/tpm_lite/tlcl.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -175,7 +175,7 @@ uint32_t TlclWrite(uint32_t index, const void* data, uint32_t length) { VBDEBUG(("TPM: TlclWrite(0x%x, %d)\n", index, length)); Memcpy(&cmd, &tpm_nv_write_cmd, sizeof(cmd)); - assert(total_length <= TPM_LARGE_ENOUGH_COMMAND_SIZE); + VbAssert(total_length <= TPM_LARGE_ENOUGH_COMMAND_SIZE); SetTpmCommandSize(cmd.buffer, total_length); ToTpmUint32(cmd.buffer + tpm_nv_write_cmd.index, index); @@ -286,7 +286,7 @@ uint32_t TlclGetPermanentFlags(TPM_PERMANENT_FLAGS* pflags) { if (result != TPM_SUCCESS) return result; FromTpmUint32(response + kTpmResponseHeaderLength, &size); - assert(size == sizeof(TPM_PERMANENT_FLAGS)); + VbAssert(size == sizeof(TPM_PERMANENT_FLAGS)); Memcpy(pflags, response + kTpmResponseHeaderLength + sizeof(size), sizeof(TPM_PERMANENT_FLAGS)); @@ -302,7 +302,7 @@ uint32_t TlclGetSTClearFlags(TPM_STCLEAR_FLAGS* vflags) { return result; FromTpmUint32(response + kTpmResponseHeaderLength, &size); /* Ugly assertion, but the struct is padded up by one byte. */ - assert(size == 7 && sizeof(TPM_STCLEAR_FLAGS) - 1 == 7); + VbAssert(size == 7 && sizeof(TPM_STCLEAR_FLAGS) - 1 == 7); Memcpy(vflags, response + kTpmResponseHeaderLength + sizeof(size), sizeof(TPM_STCLEAR_FLAGS)); -- cgit v1.2.1