summaryrefslogtreecommitdiff
path: root/utility/tlcl_generator.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2012-02-29 16:09:14 -0800
committerGerrit <chrome-bot@google.com>2012-03-01 15:25:31 -0800
commitf0605cbdc36f58829a908a3333e438c565c8c7af (patch)
tree3cbf146c627d95d2d01461ac0224d90234e802fe /utility/tlcl_generator.c
parent5ee257d94cb8aab2f3717c5cd4ceb37fbba3ec41 (diff)
downloadvboot-f0605cbdc36f58829a908a3333e438c565c8c7af.tar.gz
tpm_lite: implement TPM_GetRandom
Provide TPM_GetRandom function to library callers. BUG=chromium-os:22172 TEST=lumpy build & manual testing Change-Id: Id604fd92490ba697033158a580b0b4df1d975932 Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/17120 Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Diffstat (limited to 'utility/tlcl_generator.c')
-rw-r--r--utility/tlcl_generator.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/utility/tlcl_generator.c b/utility/tlcl_generator.c
index f905784f..bbc379c1 100644
--- a/utility/tlcl_generator.c
+++ b/utility/tlcl_generator.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
@@ -362,6 +362,14 @@ Command* BuildGetPermissionsCommand(void) {
return cmd;
}
+Command* BuildGetRandomCommand(void) {
+ int size = kTpmRequestHeaderLength + sizeof(uint32_t);
+ Command* cmd = newCommand(TPM_ORD_GetRandom, size);
+ cmd->name = "tpm_get_random_cmd";
+ AddVisibleField(cmd, "bytesRequested", kTpmRequestHeaderLength);
+ return cmd;
+}
+
/* Output the fields of a structure.
*/
void OutputFields(Field* fld) {
@@ -480,6 +488,7 @@ Command* (*builders[])(void) = {
BuildGetFlagsCommand,
BuildGetSTClearFlagsCommand,
BuildGetPermissionsCommand,
+ BuildGetRandomCommand,
BuildExtendCommand,
};