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

Side by Side Diff: firmware/lib/tpm_lite/tlcl.c

Issue 3046046: Fix GetPermissions bug. (Closed) Base URL: ssh://git@chromiumos-git/vboot_reference.git
Patch Set: Created 10 years, 4 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 | « 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) 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 /* A lightweight TPM command library. 6 /* A lightweight TPM command library.
7 * 7 *
8 * The general idea is that TPM commands are array of bytes whose 8 * The general idea is that TPM commands are array of bytes whose
9 * fields are mostly compile-time constant. The goal is to build much 9 * fields are mostly compile-time constant. The goal is to build much
10 * of the commands at compile time (or build time) and change some of 10 * of the commands at compile time (or build time) and change some of
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 283
284 uint32_t TlclGetPermissions(uint32_t index, uint32_t* permissions) { 284 uint32_t TlclGetPermissions(uint32_t index, uint32_t* permissions) {
285 struct s_tpm_getpermissions_cmd cmd; 285 struct s_tpm_getpermissions_cmd cmd;
286 uint8_t response[TPM_LARGE_ENOUGH_COMMAND_SIZE]; 286 uint8_t response[TPM_LARGE_ENOUGH_COMMAND_SIZE];
287 uint8_t* nvdata; 287 uint8_t* nvdata;
288 uint32_t result; 288 uint32_t result;
289 uint32_t size; 289 uint32_t size;
290 290
291 Memcpy(&cmd, &tpm_getpermissions_cmd, sizeof(cmd)); 291 Memcpy(&cmd, &tpm_getpermissions_cmd, sizeof(cmd));
292 ToTpmUint32(cmd.buffer + tpm_getpermissions_cmd.index, index); 292 ToTpmUint32(cmd.buffer + tpm_getpermissions_cmd.index, index);
293 TlclSendReceive(tpm_getpermissions_cmd.buffer, response, sizeof(response)); 293 TlclSendReceive(cmd.buffer, response, sizeof(response));
294 result = TpmReturnCode(response); 294 result = TpmReturnCode(response);
295 if (result != TPM_SUCCESS) { 295 if (result != TPM_SUCCESS) {
296 return result; 296 return result;
297 } 297 }
298 nvdata = response + kTpmResponseHeaderLength + sizeof(size); 298 nvdata = response + kTpmResponseHeaderLength + sizeof(size);
299 FromTpmUint32(nvdata + kNvDataPublicPermissionsOffset, permissions); 299 FromTpmUint32(nvdata + kNvDataPublicPermissionsOffset, permissions);
300 return result; 300 return result;
301 } 301 }
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