mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-01 21:53:49 +00:00
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 <reinauer@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org>
37 lines
856 B
C
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);
|
|
}
|