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

Side by Side Diff: nvtool/tpm_nv.c

Issue 3844005: Fix wrong format for printing TPM NV space indices. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/tpm.git
Patch Set: Created 10 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2009,2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2009,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 #include <stdio.h> 5 #include <stdio.h>
6 #include <string.h> 6 #include <string.h>
7 #include <sys/types.h> 7 #include <sys/types.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <netinet/in.h> 9 #include <netinet/in.h>
10 #include <uuid/uuid.h> 10 #include <uuid/uuid.h>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 cursor += sizeof(TPM_STRUCTURE_TAG); 66 cursor += sizeof(TPM_STRUCTURE_TAG);
67 67
68 value32 = OSSwapBigToHostInt32(*(UINT32*)cursor); 68 value32 = OSSwapBigToHostInt32(*(UINT32*)cursor);
69 69
70 if (value32 != nvIndex) { 70 if (value32 != nvIndex) {
71 TNV_stderr("Failed to validate NV area public data.\n"); 71 TNV_stderr("Failed to validate NV area public data.\n");
72 return FALSE; 72 return FALSE;
73 } 73 }
74 74
75 TNV_stdout("# NV Index %#08x\n", value32); 75 TNV_stdout("# NV Index %#010x\n", value32);
76 cursor += sizeof(UINT32); 76 cursor += sizeof(UINT32);
77 77
78 // pcrInfoRead begin 78 // pcrInfoRead begin
79 79
80 value16 = OSSwapBigToHostInt16(*(UINT16*)cursor); 80 value16 = OSSwapBigToHostInt16(*(UINT16*)cursor);
81 cursor += sizeof(UINT16); 81 cursor += sizeof(UINT16);
82 TNV_stdout(TNV_PUB_LABEL_FMT, "PCRs (read)"); 82 TNV_stdout(TNV_PUB_LABEL_FMT, "PCRs (read)");
83 for (i = 0, printed = 0, curPCR = 0, aPCR = 0; i < value16; i++, cursor++) { 83 for (i = 0, printed = 0, curPCR = 0, aPCR = 0; i < value16; i++, cursor++) {
84 for (j = 0; j < 8; j++) { 84 for (j = 0; j < 8; j++) {
85 if ((1 << j) & *(BYTE*)cursor) { 85 if ((1 << j) & *(BYTE*)cursor) {
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 if (TSS_EAUTH(result) == TRUE) { 815 if (TSS_EAUTH(result) == TRUE) {
816 TNV_stderr("Write: Invalid, incorrect, or missing password.\n"); 816 TNV_stderr("Write: Invalid, incorrect, or missing password.\n");
817 } else { 817 } else {
818 TNV_syslog("Tspi_NV_WriteValue", result); 818 TNV_syslog("Tspi_NV_WriteValue", result);
819 } 819 }
820 return -1; 820 return -1;
821 } 821 }
822 822
823 return 0; 823 return 0;
824 } 824 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698