| 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 two-stage locking using bGlobalLock and PP. | 6 /* Test of two-stage locking using bGlobalLock and PP. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include <stdio.h> | 9 #include <stdio.h> |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| 11 #include <stdlib.h> | 11 #include <stdlib.h> |
| 12 #include <tss/tcs.h> | |
| 13 | 12 |
| 14 #include "tlcl.h" | 13 #include "tlcl.h" |
| 15 #include "utility.h" | 14 #include "utility.h" |
| 16 | 15 |
| 17 #define INDEX0 0xcafe | 16 #define INDEX0 0xcafe |
| 18 #define INDEX1 0xcaff | 17 #define INDEX1 0xcaff |
| 19 | 18 |
| 20 int main(int argc, char** argv) { | 19 int main(int argc, char** argv) { |
| 21 uint32_t zero = 0; | 20 uint32_t zero = 0; |
| 22 uint32_t perm; | 21 uint32_t perm; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 x = 3; | 71 x = 3; |
| 73 result = TlclWrite(INDEX1, (uint8_t*) &x, sizeof(x)); | 72 result = TlclWrite(INDEX1, (uint8_t*) &x, sizeof(x)); |
| 74 if (result != TPM_E_BAD_PRESENCE) { | 73 if (result != TPM_E_BAD_PRESENCE) { |
| 75 error("INDEX1 is not locked\n"); | 74 error("INDEX1 is not locked\n"); |
| 76 exit(3); | 75 exit(3); |
| 77 } | 76 } |
| 78 | 77 |
| 79 printf("Test completed successfully\n"); | 78 printf("Test completed successfully\n"); |
| 80 exit(0); | 79 exit(0); |
| 81 } | 80 } |
| OLD | NEW |