| 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 /* This program mimicks the TPM usage from read-only firmware. It exercises | 6 /* This program mimicks the TPM usage from read-only firmware. It exercises |
| 7 * the TPM functionality needed in the read-only firmware. It is meant to be | 7 * the TPM functionality needed in the read-only firmware. It is meant to be |
| 8 * integrated with the rest of the read-only firmware. It is also provided as | 8 * integrated with the rest of the read-only firmware. It is also provided as |
| 9 * a test. | 9 * a test. |
| 10 */ | 10 */ |
| 11 | 11 |
| 12 #include <stdio.h> | 12 #include <stdio.h> |
| 13 #include <stdint.h> | 13 #include <stdint.h> |
| 14 #include <stdlib.h> | 14 #include <stdlib.h> |
| 15 #include <tss/tcs.h> | |
| 16 | 15 |
| 17 #include "tlcl.h" | 16 #include "tlcl.h" |
| 18 #include "utility.h" | 17 #include "utility.h" |
| 19 | 18 |
| 20 /* These index values are used to create NVRAM spaces. They only need to be | 19 /* These index values are used to create NVRAM spaces. They only need to be |
| 21 * unique. | 20 * unique. |
| 22 */ | 21 */ |
| 23 #define INDEX0 0xda70 | 22 #define INDEX0 0xda70 |
| 24 #define INDEX1 0xda71 | 23 #define INDEX1 0xda71 |
| 25 #define INDEX2 0xda72 | 24 #define INDEX2 0xda72 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 TlclWriteLock(INDEX0); | 100 TlclWriteLock(INDEX0); |
| 102 if (TlclWrite(INDEX0, (uint8_t*) &index_0, sizeof(index_0)) == TPM_SUCCESS) { | 101 if (TlclWrite(INDEX0, (uint8_t*) &index_0, sizeof(index_0)) == TPM_SUCCESS) { |
| 103 error("index 0 is not locked\n"); | 102 error("index 0 is not locked\n"); |
| 104 } | 103 } |
| 105 | 104 |
| 106 /* Done for now. | 105 /* Done for now. |
| 107 */ | 106 */ |
| 108 printf("Test completed successfully\n"); | 107 printf("Test completed successfully\n"); |
| 109 exit(0); | 108 exit(0); |
| 110 } | 109 } |
| OLD | NEW |