Files
OpenCellular/tests/tpm_lite/tpmtest_spaceperm.c
Randall Spangler 17f8d34109 Rename files and defines to simplify makefile.
BUG=chromium-os:26317
BRANCH=none
TEST=manual

sudo emerge vboot_reference
emerge-link vboot_reference chromeos-u-boot chromeos-installer
emerge-daisy vboot_reference chromeos-u-boot chromeos-installer

Signed-off-by: Randall Spangler <rspangler@chromium.org>
Change-Id: I8c55ca40f3f0cacf08530ab63c886fe351bcee8e
Reviewed-on: https://gerrit.chromium.org/gerrit/41152
2013-01-11 16:14:24 -08:00

37 lines
856 B
C

/* 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.
*/
/* Test of space permissions retrieval.
*/
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "host_common.h"
#include "tlcl.h"
#include "tlcl_tests.h"
#define PERMPPGL (TPM_NV_PER_PPWRITE | TPM_NV_PER_GLOBALLOCK)
#define PERMPP TPM_NV_PER_PPWRITE
int main(int argc, char** argv) {
uint32_t perm;
TlclLibInit();
TPM_CHECK(TlclStartupIfNeeded());
TPM_CHECK(TlclContinueSelfTest());
TPM_CHECK(TlclAssertPhysicalPresence());
TPM_CHECK(TlclGetPermissions(INDEX0, &perm));
VbAssert((perm & PERMPPGL) == PERMPPGL);
TPM_CHECK(TlclGetPermissions(INDEX1, &perm));
VbAssert((perm & PERMPP) == PERMPP);
printf("TEST SUCCEEDED\n");
exit(0);
}