summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattias Nissler <mnissler@chromium.org>2018-02-23 12:04:23 +0100
committerchrome-bot <chrome-bot@chromium.org>2018-04-09 05:52:55 -0700
commit13fcffe754b3b451dea54b5079fe9b7e30d685d1 (patch)
tree6ca568aed95aa7bda6bc163817f191f715560005
parent96766893f35e25c0dffe9e7961c5f74728479772 (diff)
downloadvboot-13fcffe754b3b451dea54b5079fe9b7e30d685d1.tar.gz
tpm_lite: Drop FOR_TEST for tlcl.c
firmware/lib/tpm_lite.c turned off CHROMEOS_ENVIRONMENT if FOR_TEST is enabled, resulting in a situation where code specific to CHROMEOS_ENVIRONMENT couldn't be tested. Fortunately, AFAICS tlcl_tests does not use FOR_TEST for anything useful any longer, so just drop it. BRANCH=None BUG=None TEST=FEATURES=test emerge-$BOARD -v1 vboot_reference Change-Id: I7f08ef6d2343bc60a6d2982c3cc7bae0507d94d5 Reviewed-on: https://chromium-review.googlesource.com/937703 Commit-Ready: Mattias Nissler <mnissler@chromium.org> Tested-by: Mattias Nissler <mnissler@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--Makefile7
-rw-r--r--firmware/2lib/include/2common.h15
-rw-r--r--firmware/lib/tpm_lite/tlcl.c5
3 files changed, 3 insertions, 24 deletions
diff --git a/Makefile b/Makefile
index 1f3e7f66..0480bc59 100644
--- a/Makefile
+++ b/Makefile
@@ -390,7 +390,6 @@ TLCL_SRCS = \
firmware/lib/tpm2_lite/tlcl.c \
firmware/lib/tpm2_lite/marshaling.c
endif
-TLCL_OBJS_FOR_TEST = $(TLCL_SRCS:%.c=${BUILD}/%_for_test.o)
# Support real TPM unless BIOS sets MOCK_TPM
ifeq (${MOCK_TPM},)
@@ -1288,12 +1287,6 @@ ${BUILD}/tests/rollback_index2_tests: \
TEST_OBJS += ${BUILD}/firmware/lib/rollback_index_for_test.o
endif
-${BUILD}/tests/tlcl_tests: OBJS += \
- ${TLCL_OBJS_FOR_TEST}
-${BUILD}/tests/tlcl_tests: \
- ${TLCL_OBJS_FOR_TEST}
-TEST_OBJS += ${TLCL_OBJS_FOR_TEST}
-
ifeq (${TPM2_MODE},)
# TODO(apronin): tests for TPM2 case?
TLCL_TEST_BINS = $(addprefix ${BUILD}/,${TLCL_TEST_NAMES})
diff --git a/firmware/2lib/include/2common.h b/firmware/2lib/include/2common.h
index be5c484a..7bd89075 100644
--- a/firmware/2lib/include/2common.h
+++ b/firmware/2lib/include/2common.h
@@ -29,19 +29,10 @@ struct vb2_public_key;
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
#endif
-/* Debug output printf() for tests. Otherwise, it's platform-dependent. */
+/* Platform-dependent debug output macros. */
#if defined(VBOOT_DEBUG)
-# if defined(FOR_TEST)
-# include <stdio.h>
-# define VB2_DEBUG(format, args...) do { \
- printf("%s", __func__); \
- printf(format, ## args); \
- } while(0)
-# define VB2_DEBUG_RAW(format, args...) printf(format, ## args)
-# else
-# define VB2_DEBUG(format, args...) vb2ex_printf(__func__, format, ## args)
-# define VB2_DEBUG_RAW(format, args...) vb2ex_printf(NULL, format, ## args)
-# endif
+# define VB2_DEBUG(format, args...) vb2ex_printf(__func__, format, ## args)
+# define VB2_DEBUG_RAW(format, args...) vb2ex_printf(NULL, format, ## args)
#else
# define VB2_DEBUG(format, args...)
# define VB2_DEBUG_RAW(format, args...)
diff --git a/firmware/lib/tpm_lite/tlcl.c b/firmware/lib/tpm_lite/tlcl.c
index 6f71f2bc..587a1726 100644
--- a/firmware/lib/tpm_lite/tlcl.c
+++ b/firmware/lib/tpm_lite/tlcl.c
@@ -24,11 +24,6 @@
#include "utility.h"
#include "vboot_api.h"
-#ifdef FOR_TEST
-/* Allow unit testing implementation of TlclSendReceive() */
-#undef CHROMEOS_ENVIRONMENT
-#endif
-
/* Sets the size field of a TPM command. */
static inline void SetTpmCommandSize(uint8_t* buffer, uint32_t size)
{