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

Unified Diff: firmware/lib/tpm_lite/include/tlcl.h

Issue 2919010: Add tpm lite to vboot reference (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « firmware/lib/rollback_index.c ('k') | firmware/lib/tpm_lite/include/tlcl_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: firmware/lib/tpm_lite/include/tlcl.h
diff --git a/firmware/include/tlcl.h b/firmware/lib/tpm_lite/include/tlcl.h
similarity index 74%
rename from firmware/include/tlcl.h
rename to firmware/lib/tpm_lite/include/tlcl.h
index 5bdbaa384f19415b1cdef07ebeec7dd52fa3bb75..5dfd7ef799a9e1989cfd4c49afdef1ab07af4d17 100644
--- a/firmware/include/tlcl.h
+++ b/firmware/lib/tpm_lite/include/tlcl.h
@@ -8,27 +8,16 @@
* A low-level library for interfacing to TPM hardware or an emulator.
*/
-/* FIXME(gauravsh):
- * NOTE: This file is copied over from
- * src/platform/tpm_lite/src/tlcl/tlcl.h
- * Ideally, we want to directly include it without having two maintain
- * duplicate copies in sync. But in the current model, this is hard
- * to do without breaking standalone compilation.
- * Eventually tpm_lite should be moved into vboot_reference.
- *
- * FURTHER NOTE: The subset of TPM error codes relevant to verified boot
- * (TPM_SUCCESS, etc.) are in tss_constants.h. A full list of TPM error codes
- * are in /usr/include/tss/tpm_error.h, from the trousers package.
- */
-
#ifndef TPM_LITE_TLCL_H_
#define TPM_LITE_TLCL_H_
#include "sysincludes.h"
-/* Call this first.
- */
-void TlclLibInit(void);
+/*****************************************************************************/
+/* Functions to be implemented by the stub library */
+
+/* Initialize the stub library */
+void TlclStubInit(void);
/* Close and open the device. This is needed for running more complex commands
* at user level, such as TPM_TakeOwnership, since the TPM device can be opened
@@ -37,9 +26,27 @@ void TlclLibInit(void);
void TlclCloseDevice(void);
void TlclOpenDevice(void);
-/* Sends a TPM_Startup(ST_CLEAR). Note that this is a no-op for the emulator,
- * because it runs this command during initialization. The TPM error code is
- * returned (0 for success).
+void TlclStubSendReceive(uint8_t* request, int request_length,
+ uint8_t* response, int max_length);
+
+/*****************************************************************************/
+/* Functions implemented in tlcl.c */
+
+/* Call this first.
+ */
+void TlclLibInit(void);
+
+
+/* Logs to stdout. Arguments like printf.
+ */
+void TlclLog(char* format, ...);
+
+/* Sets the log level. 0 is quietest.
+ */
+void TlclSetLogLevel(int level);
+
+/* Sends a TPM_Startup(ST_CLEAR). The TPM error code is returned (0
+ * for success).
*/
uint32_t TlclStartup(void);
@@ -48,7 +55,7 @@ uint32_t TlclStartup(void);
*/
uint32_t TlclSelftestfull(void);
-/* Runs the self test in the background. The TPM error code is returned.
+/* Runs the self test in the background.
*/
uint32_t TlclContinueSelfTest(void);
@@ -57,6 +64,11 @@ uint32_t TlclContinueSelfTest(void);
*/
uint32_t TlclDefineSpace(uint32_t index, uint32_t perm, uint32_t size);
+/* Defines a space with permission [perm]. [index] is the index for the space,
+ * [size] the usable data size. Returns the TPM error code.
+ */
+uint32_t TlclDefineSpaceResult(uint32_t index, uint32_t perm, uint32_t size);
+
/* Writes [length] bytes of [data] to space at [index]. The TPM error code is
* returned.
*/
@@ -118,6 +130,10 @@ uint32_t TlclGetFlags(uint8_t* disable, uint8_t* deactivated);
*/
uint32_t TlclSetGlobalLock(void);
+/* Performs a TPM_Extend.
+ */
+uint32_t TlclExtend(int pcr_num, uint8_t* in_digest, uint8_t* out_digest);
+
/* Gets the permission bits for the NVRAM space with |index|.
*/
uint32_t TlclGetPermissions(uint32_t index, uint32_t* permissions);
« no previous file with comments | « firmware/lib/rollback_index.c ('k') | firmware/lib/tpm_lite/include/tlcl_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698