mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-01 13:43:49 +00:00
This adds two new flags to crossystem: clear_tpm_owner_request clear_tpm_owner_done The first one requests that the firmware clear the TPM owner on the next boot. When the firmware does this, it will set clear_tpm_owner_request=0, and set clear_tpm_owner_done=1. The OS can use the done-flag as a hint that trusted things guarded by the TPM are no longer trustable. BUG=chromium-os:31974 TEST=manual crossystem // both flags initially 0 crossystem clear_tpm_owner_request=1 crossystem clear_tpm_owner_done=1 // request=1, done=0; done can be cleared but not set by crossystem reboot tpmc getownership // owned=no crossystem // request=0, done=1 crossystem clear_tpm_owner_done=0 crossystem // both flags 0 again Signed-off-by: Randall Spangler <rspangler@chromium.org> Change-Id: I49f83f3c39c3efc3945116c51a241d255c2e42cd Reviewed-on: https://gerrit.chromium.org/gerrit/25646
99 lines
2.1 KiB
C
99 lines
2.1 KiB
C
/* Copyright (c) 2012 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.
|
|
*/
|
|
|
|
#include "cgptlib.h"
|
|
#include "load_firmware_fw.h"
|
|
#include "load_kernel_fw.h"
|
|
#include "rollback_index.h"
|
|
#include "tlcl.h"
|
|
#include "tpm_bootmode.h"
|
|
#include "vboot_common.h"
|
|
#include "vboot_kernel.h"
|
|
#include "vboot_nvstorage.h"
|
|
|
|
|
|
int main(void)
|
|
{
|
|
/* cgptlib.h */
|
|
GptInit(0);
|
|
GptNextKernelEntry(0, 0, 0);
|
|
GptUpdateKernelEntry(0, 0);
|
|
|
|
/* load_firmware_fw.h */
|
|
LoadFirmware(0, 0, 0);
|
|
|
|
/* load_kernel_fw.h */
|
|
LoadKernel(0);
|
|
|
|
/* rollback_index.h */
|
|
RollbackS3Resume();
|
|
RollbackFirmwareSetup(0, 0, 0, 0, 0, 0);
|
|
RollbackFirmwareWrite(0);
|
|
RollbackFirmwareLock();
|
|
RollbackKernelRead(0);
|
|
RollbackKernelWrite(0);
|
|
RollbackKernelLock();
|
|
|
|
/* tpm_bootmode.c */
|
|
SetTPMBootModeState(0, 0, 0);
|
|
|
|
/* tlcl.h */
|
|
TlclStartup();
|
|
TlclResume();
|
|
TlclSelfTestFull();
|
|
TlclContinueSelfTest();
|
|
TlclDefineSpace(0, 0, 0);
|
|
TlclWrite(0, 0, 0);
|
|
TlclRead(0, 0, 0);
|
|
TlclWriteLock(0);
|
|
TlclReadLock(0);
|
|
TlclAssertPhysicalPresence();
|
|
TlclSetNvLocked();
|
|
TlclIsOwned();
|
|
TlclForceClear();
|
|
TlclSetEnable();
|
|
TlclClearEnable();
|
|
TlclSetDeactivated(0);
|
|
TlclGetFlags(0, 0, 0);
|
|
TlclSetGlobalLock();
|
|
TlclExtend(0, 0, 0);
|
|
TlclGetPermissions(0, 0);
|
|
|
|
/* vboot_api.h - entry points INTO vboot_reference */
|
|
VbInit(0, 0);
|
|
VbSelectFirmware(0, 0);
|
|
VbUpdateFirmwareBodyHash(0, 0, 0);
|
|
VbSelectAndLoadKernel(0, 0);
|
|
|
|
/* vboot_common.h */
|
|
OffsetOf(0, 0);
|
|
GetPublicKeyData(0);
|
|
GetPublicKeyDataC(0);
|
|
GetSignatureData(0);
|
|
GetSignatureDataC(0);
|
|
VerifyMemberInside(0, 0, 0, 0, 0, 0);
|
|
VerifyPublicKeyInside(0, 0, 0);
|
|
VerifySignatureInside(0, 0, 0);
|
|
PublicKeyInit(0, 0, 0);
|
|
PublicKeyCopy(0, 0);
|
|
PublicKeyToRSA(0);
|
|
VerifyData(0, 0, 0, 0);
|
|
VerifyDigest(0, 0, 0);
|
|
KeyBlockVerify(0, 0, 0, 0);
|
|
VerifyFirmwarePreamble(0, 0, 0);
|
|
VbGetFirmwarePreambleFlags(0);
|
|
VerifyKernelPreamble(0, 0, 0);
|
|
VbSharedDataInit(0, 0);
|
|
VbSharedDataReserve(0, 0);
|
|
VbSharedDataSetKernelKey(0, 0);
|
|
|
|
VbNvSetup(0);
|
|
VbNvGet(0, 0, 0);
|
|
VbNvSet(0, 0, 0);
|
|
VbNvTeardown(0);
|
|
|
|
return 0;
|
|
}
|