OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 2 * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 * | 5 * |
6 * Alternatively, this software may be distributed under the terms of the | 6 * Alternatively, this software may be distributed under the terms of the |
7 * GNU General Public License ("GPL") version 2 as published by the Free | 7 * GNU General Public License ("GPL") version 2 as published by the Free |
8 * Software Foundation. | 8 * Software Foundation. |
9 */ | 9 */ |
10 | 10 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 uint32_t TlclStubSendReceive(const uint8_t* request, int request_length, | 52 uint32_t TlclStubSendReceive(const uint8_t* request, int request_length, |
53 uint8_t* response, int max_length) | 53 uint8_t* response, int max_length) |
54 { | 54 { |
55 #ifdef CONFIG_HARDWARE_TPM | 55 #ifdef CONFIG_HARDWARE_TPM |
56 int ret; | 56 int ret; |
57 size_t recv_len = (size_t) max_length; | 57 size_t recv_len = (size_t) max_length; |
58 ret= tis_sendrecv(request, request_length, response, &recv_len); | 58 ret= tis_sendrecv(request, request_length, response, &recv_len); |
59 if (ret) | 59 if (ret) |
60 return TPM_E_IOERROR; | 60 return TPM_E_IOERROR; |
| 61 #else |
| 62 /* Make a successful response */ |
| 63 uint8_t successful_response[10] = |
| 64 {0x0, 0x0, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x0}; |
| 65 memcpy(response, successful_response, 10); |
61 #endif | 66 #endif |
62 return TPM_SUCCESS; | 67 return TPM_SUCCESS; |
63 } | 68 } |
64 | 69 |
OLD | NEW |