| 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 * Stub implementations of utility functions which call their linux-specific | 5 * Stub implementations of utility functions which call their linux-specific |
| 6 * equivalents. | 6 * equivalents. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #define _STUB_IMPLEMENTATION_ | 9 #define _STUB_IMPLEMENTATION_ |
| 10 #include "tlcl.h" | 10 #include "tlcl.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 * remove the wrappers and call us directly. */ | 29 * remove the wrappers and call us directly. */ |
| 30 | 30 |
| 31 | 31 |
| 32 /* The file descriptor for the TPM device. | 32 /* The file descriptor for the TPM device. |
| 33 */ | 33 */ |
| 34 static int tpm_fd = -1; | 34 static int tpm_fd = -1; |
| 35 | 35 |
| 36 | 36 |
| 37 /* Print |n| bytes from array |a|, with newlines. | 37 /* Print |n| bytes from array |a|, with newlines. |
| 38 */ | 38 */ |
| 39 POSSIBLY_UNUSED static void PrintBytes(uint8_t* a, int n) { | 39 POSSIBLY_UNUSED static void PrintBytes(const uint8_t* a, int n) { |
| 40 int i; | 40 int i; |
| 41 for (i = 0; i < n; i++) { | 41 for (i = 0; i < n; i++) { |
| 42 VBDEBUG(("%02x ", a[i])); | 42 VBDEBUG(("%02x ", a[i])); |
| 43 if ((i + 1) % 16 == 0) { | 43 if ((i + 1) % 16 == 0) { |
| 44 VBDEBUG(("\n")); | 44 VBDEBUG(("\n")); |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 if (i % 16 != 0) { | 47 if (i % 16 != 0) { |
| 48 VBDEBUG(("\n")); | 48 VBDEBUG(("\n")); |
| 49 } | 49 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 (tag == TPM_TAG_RQU_COMMAND && | 178 (tag == TPM_TAG_RQU_COMMAND && |
| 179 response_tag == TPM_TAG_RSP_COMMAND) || | 179 response_tag == TPM_TAG_RSP_COMMAND) || |
| 180 (tag == TPM_TAG_RQU_AUTH1_COMMAND && | 180 (tag == TPM_TAG_RQU_AUTH1_COMMAND && |
| 181 response_tag == TPM_TAG_RSP_AUTH1_COMMAND) || | 181 response_tag == TPM_TAG_RSP_AUTH1_COMMAND) || |
| 182 (tag == TPM_TAG_RQU_AUTH2_COMMAND && | 182 (tag == TPM_TAG_RQU_AUTH2_COMMAND && |
| 183 response_tag == TPM_TAG_RSP_AUTH2_COMMAND)); | 183 response_tag == TPM_TAG_RSP_AUTH2_COMMAND)); |
| 184 assert(response_length == TpmResponseSize(response)); | 184 assert(response_length == TpmResponseSize(response)); |
| 185 | 185 |
| 186 return 0; /* Success */ | 186 return 0; /* Success */ |
| 187 } | 187 } |
| OLD | NEW |