| OLD | NEW | 
|---|
| 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  Loading... | 
| 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  Loading... | 
| 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 } | 
| OLD | NEW | 
|---|