vboot/secdata: rename rollback_index to secdata_tpm
These secure spaces are now used for more than just rollback versions and should be renamed thus. Note: Originally this rename operation was batched into the CL which rewrites the functions in rollback_index/secdata_tpm, but it made reviewing in Gerrit a pain, since it couldn't pick up on the file renames, and instead showed them as deletes/adds. Doing the rename separately helps ensure all references to rollback_index are updated, and gives us a better review experience in Gerrit. BUG=b:124141368, chromium:972956 TEST=make clean && make runtests BRANCH=none Change-Id: I51e5c731e0d7a071d384c28da56e7adce64ba943 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1776279 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
parent
0961b80b9d
commit
110df5cafa
14
Makefile
14
Makefile
|
@ -395,11 +395,11 @@ endif
|
||||||
# Support real TPM unless BIOS sets MOCK_TPM
|
# Support real TPM unless BIOS sets MOCK_TPM
|
||||||
ifeq (${MOCK_TPM},)
|
ifeq (${MOCK_TPM},)
|
||||||
FWLIB_SRCS += \
|
FWLIB_SRCS += \
|
||||||
firmware/lib/rollback_index.c \
|
firmware/lib/secdata_tpm.c \
|
||||||
${TLCL_SRCS}
|
${TLCL_SRCS}
|
||||||
else
|
else
|
||||||
FWLIB_SRCS += \
|
FWLIB_SRCS += \
|
||||||
firmware/lib/mocked_rollback_index.c \
|
firmware/lib/mocked_secdata_tpm.c \
|
||||||
firmware/lib/tpm_lite/mocked_tlcl.c
|
firmware/lib/tpm_lite/mocked_tlcl.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -691,10 +691,10 @@ TEST_NAMES = \
|
||||||
|
|
||||||
ifeq (${TPM2_MODE}${MOCK_TPM},)
|
ifeq (${TPM2_MODE}${MOCK_TPM},)
|
||||||
# TODO(apronin): tests for TPM2 case?
|
# TODO(apronin): tests for TPM2 case?
|
||||||
# tlcl_tests and rollback_index2_tests only work when MOCK_TPM is disabled
|
# secdata_tpm_tests and tlcl_tests only work when MOCK_TPM is disabled
|
||||||
TEST_NAMES += \
|
TEST_NAMES += \
|
||||||
tests/tlcl_tests \
|
tests/secdata_tpm_tests \
|
||||||
tests/rollback_index2_tests
|
tests/tlcl_tests
|
||||||
endif
|
endif
|
||||||
|
|
||||||
TEST_FUTIL_NAMES = \
|
TEST_FUTIL_NAMES = \
|
||||||
|
@ -1255,9 +1255,9 @@ runmisctests: test_setup
|
||||||
${RUNTEST} ${BUILD_RUN}/tests/ec_sync_tests
|
${RUNTEST} ${BUILD_RUN}/tests/ec_sync_tests
|
||||||
ifeq (${TPM2_MODE}${MOCK_TPM},)
|
ifeq (${TPM2_MODE}${MOCK_TPM},)
|
||||||
# TODO(apronin): tests for TPM2 case?
|
# TODO(apronin): tests for TPM2 case?
|
||||||
# tlcl_tests and rollback_index2_tests only work when MOCK_TPM is disabled
|
# secdata_tpm_tests and tlcl_tests only work when MOCK_TPM is disabled
|
||||||
|
${RUNTEST} ${BUILD_RUN}/tests/secdata_tpm_tests
|
||||||
${RUNTEST} ${BUILD_RUN}/tests/tlcl_tests
|
${RUNTEST} ${BUILD_RUN}/tests/tlcl_tests
|
||||||
${RUNTEST} ${BUILD_RUN}/tests/rollback_index2_tests
|
|
||||||
endif
|
endif
|
||||||
${RUNTEST} ${BUILD_RUN}/tests/utility_string_tests
|
${RUNTEST} ${BUILD_RUN}/tests/utility_string_tests
|
||||||
${RUNTEST} ${BUILD_RUN}/tests/vboot_api_devmode_tests
|
${RUNTEST} ${BUILD_RUN}/tests/vboot_api_devmode_tests
|
||||||
|
|
|
@ -2,12 +2,12 @@
|
||||||
* Use of this source code is governed by a BSD-style license that can be
|
* Use of this source code is governed by a BSD-style license that can be
|
||||||
* found in the LICENSE file.
|
* found in the LICENSE file.
|
||||||
*
|
*
|
||||||
* Functions for querying, manipulating and locking rollback indices
|
* Functions for querying, manipulating and locking secure data spaces
|
||||||
* stored in the TPM NVRAM.
|
* stored in the TPM NVRAM.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef VBOOT_REFERENCE_ROLLBACK_INDEX_H_
|
#ifndef VBOOT_REFERENCE_SECDATA_TPM_H_
|
||||||
#define VBOOT_REFERENCE_ROLLBACK_INDEX_H_
|
#define VBOOT_REFERENCE_SECDATA_TPM_H_
|
||||||
|
|
||||||
#include "2return_codes.h"
|
#include "2return_codes.h"
|
||||||
#include "2sysincludes.h"
|
#include "2sysincludes.h"
|
||||||
|
@ -170,4 +170,4 @@ uint32_t SafeWrite(uint32_t index, const void *data, uint32_t length);
|
||||||
*/
|
*/
|
||||||
vb2_error_t SetVirtualDevMode(int val);
|
vb2_error_t SetVirtualDevMode(int val);
|
||||||
|
|
||||||
#endif /* VBOOT_REFERENCE_ROLLBACK_INDEX_H_ */
|
#endif /* VBOOT_REFERENCE_SECDATA_TPM_H_ */
|
|
@ -2,12 +2,12 @@
|
||||||
* Use of this source code is governed by a BSD-style license that can be
|
* Use of this source code is governed by a BSD-style license that can be
|
||||||
* found in the LICENSE file.
|
* found in the LICENSE file.
|
||||||
*
|
*
|
||||||
* Functions for querying, manipulating and locking rollback indices
|
* Functions for querying, manipulating and locking secure data spaces
|
||||||
* stored in the TPM NVRAM.
|
* stored in the TPM NVRAM.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "utility.h"
|
#include "utility.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "tss_constants.h"
|
#include "tss_constants.h"
|
||||||
|
|
||||||
vb2_error_t SetVirtualDevMode(int val)
|
vb2_error_t SetVirtualDevMode(int val)
|
|
@ -2,14 +2,14 @@
|
||||||
* Use of this source code is governed by a BSD-style license that can be
|
* Use of this source code is governed by a BSD-style license that can be
|
||||||
* found in the LICENSE file.
|
* found in the LICENSE file.
|
||||||
*
|
*
|
||||||
* Functions for querying, manipulating and locking rollback indices
|
* Functions for querying, manipulating and locking secure data spaces
|
||||||
* stored in the TPM NVRAM.
|
* stored in the TPM NVRAM.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "2sysincludes.h"
|
#include "2sysincludes.h"
|
||||||
#include "2common.h"
|
#include "2common.h"
|
||||||
#include "2crc8.h"
|
#include "2crc8.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "tlcl.h"
|
#include "tlcl.h"
|
||||||
#include "tss_constants.h"
|
#include "tss_constants.h"
|
||||||
#include "vboot_api.h"
|
#include "vboot_api.h"
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
#define RETURN_ON_FAILURE(tpm_command) do { \
|
#define RETURN_ON_FAILURE(tpm_command) do { \
|
||||||
uint32_t result_; \
|
uint32_t result_; \
|
||||||
if ((result_ = (tpm_command)) != TPM_SUCCESS) { \
|
if ((result_ = (tpm_command)) != TPM_SUCCESS) { \
|
||||||
VB2_DEBUG("Rollback: %08x returned by " #tpm_command \
|
VB2_DEBUG("TPM: 0x%x returned by " #tpm_command \
|
||||||
"\n", (int)result_); \
|
"\n", (int)result_); \
|
||||||
return result_; \
|
return result_; \
|
||||||
} \
|
} \
|
|
@ -7,7 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "2common.h"
|
#include "2common.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "2sysincludes.h"
|
#include "2sysincludes.h"
|
||||||
#include "tlcl.h"
|
#include "tlcl.h"
|
||||||
#include "tpm2_marshaling.h"
|
#include "tpm2_marshaling.h"
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include "2sysincludes.h"
|
#include "2sysincludes.h"
|
||||||
#include "ec_sync.h"
|
#include "ec_sync.h"
|
||||||
#include "load_kernel_fw.h"
|
#include "load_kernel_fw.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "utility.h"
|
#include "utility.h"
|
||||||
#include "vb2_common.h"
|
#include "vb2_common.h"
|
||||||
#include "vboot_api.h"
|
#include "vboot_api.h"
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include "cgptlib_internal.h"
|
#include "cgptlib_internal.h"
|
||||||
#include "gpt_misc.h"
|
#include "gpt_misc.h"
|
||||||
#include "load_kernel_fw.h"
|
#include "load_kernel_fw.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "utility.h"
|
#include "utility.h"
|
||||||
#include "vb2_common.h"
|
#include "vb2_common.h"
|
||||||
#include "vboot_api.h"
|
#include "vboot_api.h"
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "2secdata.h"
|
#include "2secdata.h"
|
||||||
#include "ec_sync.h"
|
#include "ec_sync.h"
|
||||||
#include "load_kernel_fw.h"
|
#include "load_kernel_fw.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "tlcl.h"
|
#include "tlcl.h"
|
||||||
#include "utility.h"
|
#include "utility.h"
|
||||||
#include "vb2_common.h"
|
#include "vb2_common.h"
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "2common.h"
|
#include "2common.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "2sysincludes.h"
|
#include "2sysincludes.h"
|
||||||
#include "vboot_api.h"
|
#include "vboot_api.h"
|
||||||
#include "vboot_kernel.h"
|
#include "vboot_kernel.h"
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#include "2sysincludes.h"
|
#include "2sysincludes.h"
|
||||||
#include "ec_sync.h"
|
#include "ec_sync.h"
|
||||||
#include "load_kernel_fw.h"
|
#include "load_kernel_fw.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "utility.h"
|
#include "utility.h"
|
||||||
#include "vb2_common.h"
|
#include "vb2_common.h"
|
||||||
#include "vboot_api.h"
|
#include "vboot_api.h"
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include "2sysincludes.h"
|
#include "2sysincludes.h"
|
||||||
#include "cgptlib.h"
|
#include "cgptlib.h"
|
||||||
#include "load_kernel_fw.h"
|
#include "load_kernel_fw.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "tlcl.h"
|
#include "tlcl.h"
|
||||||
#include "vboot_common.h"
|
#include "vboot_common.h"
|
||||||
#include "vboot_kernel.h"
|
#include "vboot_kernel.h"
|
||||||
|
@ -22,7 +22,7 @@ int main(void)
|
||||||
/* load_kernel_fw.h */
|
/* load_kernel_fw.h */
|
||||||
LoadKernel(0, 0);
|
LoadKernel(0, 0);
|
||||||
|
|
||||||
/* rollback_index.h */
|
/* secdata_tpm.h */
|
||||||
RollbackKernelRead(0);
|
RollbackKernelRead(0);
|
||||||
RollbackKernelWrite(0);
|
RollbackKernelWrite(0);
|
||||||
RollbackKernelLock(0);
|
RollbackKernelLock(0);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include "ec_sync.h"
|
#include "ec_sync.h"
|
||||||
#include "host_common.h"
|
#include "host_common.h"
|
||||||
#include "load_kernel_fw.h"
|
#include "load_kernel_fw.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "test_common.h"
|
#include "test_common.h"
|
||||||
#include "vboot_audio.h"
|
#include "vboot_audio.h"
|
||||||
#include "vboot_common.h"
|
#include "vboot_common.h"
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
# Copyright (c) 2010 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.
|
|
||||||
|
|
||||||
# Rollback code exhaustive test.
|
|
||||||
#
|
|
||||||
# INSTRUCTIONS. Put this file in /etc/init. Move /etc/init/tcsd.conf to
|
|
||||||
# /etc/init/tcsd.confxxx to disable it. Then boot with the device connected by
|
|
||||||
# wired ethernet. The test will start and reboot the host after every cycle.
|
|
||||||
# Unplug the ethernet cable to stop testing. If left alone, the test will stop
|
|
||||||
# at the first failure or when all the states have been tested.
|
|
||||||
#
|
|
||||||
# Reminder: rollback_index_test only works with TPM-agnostic firmware.
|
|
||||||
|
|
||||||
# Connecting to tcsd requires that "localhost" be reachable, so we wait for
|
|
||||||
# shill to start, but that's not enough, and in the while loop below we also
|
|
||||||
# wait for pinging to localhost to succeed.
|
|
||||||
|
|
||||||
start on started shill
|
|
||||||
|
|
||||||
script
|
|
||||||
cable=""
|
|
||||||
while [ "$cable" != "yes" ]; do
|
|
||||||
cable=$(/usr/sbin/ethtool eth0 | grep Link | cut -f 3 -d ' ')
|
|
||||||
logger "rbtest: cable is $cable"
|
|
||||||
ping -c 1 localhost || cable=""
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
# ideally we would like to issue a "stop tcsd", but this doesn't work
|
|
||||||
# (upstart race?) so we must manually disable tcsd.conf
|
|
||||||
### stop tcsd
|
|
||||||
logger "starting rbtest"
|
|
||||||
/usr/bin/rollback_index_test > /tmp/rbtest.out 2>&1
|
|
||||||
end script
|
|
|
@ -2,7 +2,7 @@
|
||||||
* Use of this source code is governed by a BSD-style license that can be
|
* Use of this source code is governed by a BSD-style license that can be
|
||||||
* found in the LICENSE file.
|
* found in the LICENSE file.
|
||||||
*
|
*
|
||||||
* Tests for rollback_index functions
|
* Tests for secdata_tpm functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "2crc8.h"
|
#include "2crc8.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "test_common.h"
|
#include "test_common.h"
|
||||||
#include "tlcl.h"
|
#include "tlcl.h"
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include "crc32.h"
|
#include "crc32.h"
|
||||||
#include "host_common.h"
|
#include "host_common.h"
|
||||||
#include "load_kernel_fw.h"
|
#include "load_kernel_fw.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "test_common.h"
|
#include "test_common.h"
|
||||||
#include "vboot_common.h"
|
#include "vboot_common.h"
|
||||||
#include "vboot_display.h"
|
#include "vboot_display.h"
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include "2secdata.h"
|
#include "2secdata.h"
|
||||||
#include "host_common.h"
|
#include "host_common.h"
|
||||||
#include "load_kernel_fw.h"
|
#include "load_kernel_fw.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "test_common.h"
|
#include "test_common.h"
|
||||||
#include "vboot_audio.h"
|
#include "vboot_audio.h"
|
||||||
#include "vboot_common.h"
|
#include "vboot_common.h"
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include "ec_sync.h"
|
#include "ec_sync.h"
|
||||||
#include "host_common.h"
|
#include "host_common.h"
|
||||||
#include "load_kernel_fw.h"
|
#include "load_kernel_fw.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "test_common.h"
|
#include "test_common.h"
|
||||||
#include "vboot_audio.h"
|
#include "vboot_audio.h"
|
||||||
#include "vboot_common.h"
|
#include "vboot_common.h"
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include "2struct.h"
|
#include "2struct.h"
|
||||||
#include "host_common.h"
|
#include "host_common.h"
|
||||||
#include "load_kernel_fw.h"
|
#include "load_kernel_fw.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "test_common.h"
|
#include "test_common.h"
|
||||||
#include "vb2_common.h"
|
#include "vb2_common.h"
|
||||||
#include "vboot_api.h"
|
#include "vboot_api.h"
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include "2common.h"
|
#include "2common.h"
|
||||||
#include "2nvstorage.h"
|
#include "2nvstorage.h"
|
||||||
#include "load_kernel_fw.h"
|
#include "load_kernel_fw.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "test_common.h"
|
#include "test_common.h"
|
||||||
#include "utility.h"
|
#include "utility.h"
|
||||||
#include "vboot_api.h"
|
#include "vboot_api.h"
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include "2secdata.h"
|
#include "2secdata.h"
|
||||||
#include "host_common.h"
|
#include "host_common.h"
|
||||||
#include "load_kernel_fw.h"
|
#include "load_kernel_fw.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "test_common.h"
|
#include "test_common.h"
|
||||||
#include "vboot_api.h"
|
#include "vboot_api.h"
|
||||||
#include "vboot_audio.h"
|
#include "vboot_audio.h"
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#include "gpt.h"
|
#include "gpt.h"
|
||||||
#include "host_common.h"
|
#include "host_common.h"
|
||||||
#include "load_kernel_fw.h"
|
#include "load_kernel_fw.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "test_common.h"
|
#include "test_common.h"
|
||||||
#include "vb2_common.h"
|
#include "vb2_common.h"
|
||||||
#include "vb2_struct.h"
|
#include "vb2_struct.h"
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
#include "2misc.h"
|
#include "2misc.h"
|
||||||
#include "host_common.h"
|
#include "host_common.h"
|
||||||
#include "load_kernel_fw.h"
|
#include "load_kernel_fw.h"
|
||||||
#include "rollback_index.h"
|
#include "secdata_tpm.h"
|
||||||
#include "vboot_common.h"
|
#include "vboot_common.h"
|
||||||
#include "vboot_kernel.h"
|
#include "vboot_kernel.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue