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

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

Issue 3041005: Add lots of debugging to TPM library. (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Fix TPM unit tests 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/lock.c ('k') | tests/tpm_lite/redefine.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 */
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } 62 }
63 63
64 64
65 int main(int argc, char** argv) { 65 int main(int argc, char** argv) {
66 uint8_t c; 66 uint8_t c;
67 uint32_t index_0, index_1, index_2, index_3; 67 uint32_t index_0, index_1, index_2, index_3;
68 68
69 TlclLibInit(); 69 TlclLibInit();
70 70
71 TlclStartup(); 71 TlclStartup();
72 TlclSelftestfull(); 72 TlclSelfTestFull();
73 73
74 TlclAssertPhysicalPresence(); 74 TlclAssertPhysicalPresence();
75 75
76 /* Checks if initialization has completed by trying to read-lock a space 76 /* Checks if initialization has completed by trying to read-lock a space
77 * that's created at the end of initialization. 77 * that's created at the end of initialization.
78 */ 78 */
79 if (TlclRead(INDEX_INITIALIZED, &c, 0) == TPM_E_BADINDEX) { 79 if (TlclRead(INDEX_INITIALIZED, &c, 0) == TPM_E_BADINDEX) {
80 /* The initialization did not complete. 80 /* The initialization did not complete.
81 */ 81 */
82 InitializeSpaces(); 82 InitializeSpaces();
(...skipping 18 matching lines...) Expand all
101 TlclWriteLock(INDEX0); 101 TlclWriteLock(INDEX0);
102 if (TlclWrite(INDEX0, (uint8_t*) &index_0, sizeof(index_0)) == TPM_SUCCESS) { 102 if (TlclWrite(INDEX0, (uint8_t*) &index_0, sizeof(index_0)) == TPM_SUCCESS) {
103 error("index 0 is not locked\n"); 103 error("index 0 is not locked\n");
104 } 104 }
105 105
106 /* Done for now. 106 /* Done for now.
107 */ 107 */
108 printf("Test completed successfully\n"); 108 printf("Test completed successfully\n");
109 exit(0); 109 exit(0);
110 } 110 }
OLDNEW
« no previous file with comments | « tests/tpm_lite/lock.c ('k') | tests/tpm_lite/redefine.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698