OLD | NEW |
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 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 | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 /* Test of protection from space redefinition. | 6 /* Test of protection from space redefinition. |
7 * | 7 * |
8 * This test is actually not that interesting because, if I am right, space | 8 * This test is actually not that interesting because, if I am right, space |
9 * redefinition is not allowed with PP only. It requires | 9 * redefinition is not allowed with PP only. It requires |
10 * TPM_TAG_RQU_AUTH1_COMMAND with owner authentication. | 10 * TPM_TAG_RQU_AUTH1_COMMAND with owner authentication. |
11 */ | 11 */ |
12 | 12 |
13 #include <stdio.h> | 13 #include <stdio.h> |
14 #include <stdint.h> | 14 #include <stdint.h> |
15 #include <stdlib.h> | 15 #include <stdlib.h> |
16 #include <tss/tcs.h> | |
17 | 16 |
18 #include "tlcl.h" | 17 #include "tlcl.h" |
19 #include "utility.h" | 18 #include "utility.h" |
20 | 19 |
21 #define INDEX0 0xcafe | 20 #define INDEX0 0xcafe |
22 #define INDEX1 0xcaff | 21 #define INDEX1 0xcaff |
23 | 22 |
24 int main(int argc, char** argv) { | 23 int main(int argc, char** argv) { |
25 uint32_t perm; | 24 uint32_t perm; |
26 uint32_t result; | 25 uint32_t result; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } | 69 } |
71 result = TlclDefineSpace(INDEX1, perm, sizeof(uint32_t)); | 70 result = TlclDefineSpace(INDEX1, perm, sizeof(uint32_t)); |
72 if (result == TPM_SUCCESS) { | 71 if (result == TPM_SUCCESS) { |
73 error("unexpected success redefining INDEX1\n"); | 72 error("unexpected success redefining INDEX1\n"); |
74 exit(1); | 73 exit(1); |
75 } | 74 } |
76 | 75 |
77 printf("Test completed successfully\n"); | 76 printf("Test completed successfully\n"); |
78 exit(0); | 77 exit(0); |
79 } | 78 } |
OLD | NEW |