Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: tests/tpm_lite/spaceperm.c

Issue 2919010: Add tpm lite to vboot reference (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/tpm_lite/redefine.c ('k') | tests/tpm_lite/writelimit.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
5
6 /* Test of space permissions retrieval. The spaces 0xcafe and 0xcaff must have
7 * already been defined (by running, for instance, the "redefine" test).
8 */
9
10 #include <stdint.h>
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <tss/tcs.h>
14
15 #include "tlcl.h"
16 #include "utility.h"
17
18 #define INDEX0 0xcafe
19 #define INDEX1 0xcaff
20
21 int main(int argc, char** argv) {
22 uint32_t perm;
23 uint32_t perm_pp_gl = TPM_NV_PER_PPWRITE | TPM_NV_PER_GLOBALLOCK;
24 uint32_t perm_pp = TPM_NV_PER_PPWRITE;
25 uint32_t result;
26
27 TlclLibInit();
28 TlclStartup();
29 TlclContinueSelfTest();
30 TlclAssertPhysicalPresence();
31
32 result = TlclGetPermissions(INDEX0, &perm);
33 assert(result == TPM_SUCCESS);
34 printf("permissions for INDEX0 = 0x%x\n", perm);
35 assert((perm & perm_pp_gl) == perm_pp_gl);
36
37 result = TlclGetPermissions(INDEX1, &perm);
38 assert(result == TPM_SUCCESS);
39 printf("permissions for INDEX1 = 0x%x\n", perm);
40 assert((perm & perm_pp) == perm_pp);
41
42 printf("Test completed successfully\n");
43 exit(0);
44 }
OLDNEW
« no previous file with comments | « tests/tpm_lite/redefine.c ('k') | tests/tpm_lite/writelimit.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698