diff options
author | Luigi Semenzato <semenzato@google.com> | 2010-08-31 15:49:56 -0700 |
---|---|---|
committer | Luigi Semenzato <semenzato@google.com> | 2010-08-31 15:49:56 -0700 |
commit | 89a02c194f1b6da0de7f98784d85e6827c3a1aec (patch) | |
tree | 1f94fdba1517e5126270ba9935714e082f91ee96 /firmware | |
parent | 3da063e3f7612464a41a4c9b2b31fb7eade57a13 (diff) | |
download | vboot-89a02c194f1b6da0de7f98784d85e6827c3a1aec.tar.gz |
Make TPM datagrams const, since they cannot be modified in the RO firmware.
Change-Id: I7f135584536c7437824ae65f74a8f7ef27c28665
BUG=
TEST=
Review URL: http://codereview.chromium.org/3271006
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/lib/tpm_lite/include/tlcl.h | 2 | ||||
-rw-r--r-- | firmware/lib/tpm_lite/include/tlcl_structures.h | 40 | ||||
-rw-r--r-- | firmware/lib/tpm_lite/tlcl.c | 4 | ||||
-rw-r--r-- | firmware/stub/tpm_lite_stub.c | 4 | ||||
-rw-r--r-- | firmware/version.c | 2 |
5 files changed, 26 insertions, 26 deletions
diff --git a/firmware/lib/tpm_lite/include/tlcl.h b/firmware/lib/tpm_lite/include/tlcl.h index 09ccb9f2..e5ff63ad 100644 --- a/firmware/lib/tpm_lite/include/tlcl.h +++ b/firmware/lib/tpm_lite/include/tlcl.h @@ -29,7 +29,7 @@ void TlclOpenDevice(void); /* Send data to the TPM and receive a response. Returns 0 if success, * nonzero if error. */ -uint32_t TlclStubSendReceive(uint8_t* request, int request_length, +uint32_t TlclStubSendReceive(const uint8_t* request, int request_length, uint8_t* response, int max_length); /*****************************************************************************/ diff --git a/firmware/lib/tpm_lite/include/tlcl_structures.h b/firmware/lib/tpm_lite/include/tlcl_structures.h index 53d6bdd6..53e70aed 100644 --- a/firmware/lib/tpm_lite/include/tlcl_structures.h +++ b/firmware/lib/tpm_lite/include/tlcl_structures.h @@ -1,102 +1,102 @@ /* This file is automatically generated */ -struct s_tpm_extend_cmd{ +const struct s_tpm_extend_cmd{ uint8_t buffer[34]; uint16_t pcrNum; uint16_t inDigest; } tpm_extend_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0x22, 0x0, 0x0, 0x0, 0x14, }, 10, 14, }; -struct s_tpm_getpermissions_cmd{ +const struct s_tpm_getpermissions_cmd{ uint8_t buffer[22]; uint16_t index; } tpm_getpermissions_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0x16, 0x0, 0x0, 0x0, 0x65, 0x0, 0x0, 0x0, 0x11, 0x0, 0x0, 0x0, 0x4, }, 18, }; -struct s_tpm_getstclearflags_cmd{ +const struct s_tpm_getstclearflags_cmd{ uint8_t buffer[22]; } tpm_getstclearflags_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0x16, 0x0, 0x0, 0x0, 0x65, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x1, 0x9, }, }; -struct s_tpm_getflags_cmd{ +const struct s_tpm_getflags_cmd{ uint8_t buffer[22]; } tpm_getflags_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0x16, 0x0, 0x0, 0x0, 0x65, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x1, 0x8, }, }; -struct s_tpm_physicalsetdeactivated_cmd{ +const struct s_tpm_physicalsetdeactivated_cmd{ uint8_t buffer[11]; uint16_t deactivated; } tpm_physicalsetdeactivated_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xb, 0x0, 0x0, 0x0, 0x72, }, 10, }; -struct s_tpm_physicalenable_cmd{ +const struct s_tpm_physicalenable_cmd{ uint8_t buffer[10]; } tpm_physicalenable_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x6f, }, }; -struct s_tpm_physicaldisable_cmd{ +const struct s_tpm_physicaldisable_cmd{ uint8_t buffer[10]; } tpm_physicaldisable_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x70, }, }; -struct s_tpm_forceclear_cmd{ +const struct s_tpm_forceclear_cmd{ uint8_t buffer[10]; } tpm_forceclear_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x5d, }, }; -struct s_tpm_readpubek_cmd{ +const struct s_tpm_readpubek_cmd{ uint8_t buffer[30]; } tpm_readpubek_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0x1e, 0x0, 0x0, 0x0, 0x7c, }, }; -struct s_tpm_continueselftest_cmd{ +const struct s_tpm_continueselftest_cmd{ uint8_t buffer[10]; } tpm_continueselftest_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x53, }, }; -struct s_tpm_selftestfull_cmd{ +const struct s_tpm_selftestfull_cmd{ uint8_t buffer[10]; } tpm_selftestfull_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xa, 0x0, 0x0, 0x0, 0x50, }, }; -struct s_tpm_resume_cmd{ +const struct s_tpm_resume_cmd{ uint8_t buffer[12]; } tpm_resume_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0x99, 0x0, 0x2, }, }; -struct s_tpm_startup_cmd{ +const struct s_tpm_startup_cmd{ uint8_t buffer[12]; } tpm_startup_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xc, 0x0, 0x0, 0x0, 0x99, 0x0, 0x1, }, }; -struct s_tpm_finalizepp_cmd{ +const struct s_tpm_finalizepp_cmd{ uint8_t buffer[12]; } tpm_finalizepp_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xc, 0x40, 0x0, 0x0, 0xa, 0x2, 0xa0, }, }; -struct s_tpm_pplock_cmd{ +const struct s_tpm_pplock_cmd{ uint8_t buffer[12]; } tpm_pplock_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xc, 0x40, 0x0, 0x0, 0xa, 0x0, 0x4, }, }; -struct s_tpm_ppenable_cmd{ +const struct s_tpm_ppenable_cmd{ uint8_t buffer[12]; } tpm_ppenable_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xc, 0x40, 0x0, 0x0, 0xa, 0x0, 0x20, }, }; -struct s_tpm_ppassert_cmd{ +const struct s_tpm_ppassert_cmd{ uint8_t buffer[12]; } tpm_ppassert_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0xc, 0x40, 0x0, 0x0, 0xa, 0x0, 0x8, }, }; -struct s_tpm_nv_read_cmd{ +const struct s_tpm_nv_read_cmd{ uint8_t buffer[22]; uint16_t index; uint16_t length; } tpm_nv_read_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0x16, 0x0, 0x0, 0x0, 0xcf, }, 10, 18, }; -struct s_tpm_nv_write_cmd{ +const struct s_tpm_nv_write_cmd{ uint8_t buffer[256]; uint16_t index; uint16_t length; @@ -104,7 +104,7 @@ struct s_tpm_nv_write_cmd{ } tpm_nv_write_cmd = {{0x0, 0xc1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xcd, }, 10, 18, 22, }; -struct s_tpm_nv_definespace_cmd{ +const struct s_tpm_nv_definespace_cmd{ uint8_t buffer[101]; uint16_t index; uint16_t perm; diff --git a/firmware/lib/tpm_lite/tlcl.c b/firmware/lib/tpm_lite/tlcl.c index 3f314df7..39c92e6f 100644 --- a/firmware/lib/tpm_lite/tlcl.c +++ b/firmware/lib/tpm_lite/tlcl.c @@ -47,7 +47,7 @@ static INLINE int TpmReturnCode(const uint8_t* buffer) { /* Sends a TPM command and gets a response. Returns 0 if success or the TPM * error code if error. */ -static uint32_t TlclSendReceive(uint8_t* request, uint8_t* response, +static uint32_t TlclSendReceive(const uint8_t* request, uint8_t* response, int max_length) { uint32_t result; @@ -85,7 +85,7 @@ static uint32_t TlclSendReceive(uint8_t* request, uint8_t* response, /* Sends a command and returns the error code. */ -static uint32_t Send(uint8_t* command) { +static uint32_t Send(const uint8_t* command) { uint8_t response[TPM_LARGE_ENOUGH_COMMAND_SIZE]; return TlclSendReceive(command, response, sizeof(response)); } diff --git a/firmware/stub/tpm_lite_stub.c b/firmware/stub/tpm_lite_stub.c index 3dc3dfea..6df84645 100644 --- a/firmware/stub/tpm_lite_stub.c +++ b/firmware/stub/tpm_lite_stub.c @@ -84,7 +84,7 @@ static void TpmExecute(const uint8_t *in, const uint32_t in_len, /* Gets the tag field of a TPM command. */ -POSSIBLY_UNUSED static INLINE int TpmTag(uint8_t* buffer) { +POSSIBLY_UNUSED static INLINE int TpmTag(const uint8_t* buffer) { uint16_t tag; FromTpmUint16(buffer, &tag); return (int) tag; @@ -129,7 +129,7 @@ void TlclOpenDevice(void) { } -uint32_t TlclStubSendReceive(uint8_t* request, int request_length, +uint32_t TlclStubSendReceive(const uint8_t* request, int request_length, uint8_t* response, int max_length) { /* * In a real firmware implementation, this function should contain diff --git a/firmware/version.c b/firmware/version.c index 2675a3a4..85a841d0 100644 --- a/firmware/version.c +++ b/firmware/version.c @@ -1 +1 @@ -char* VbootVersion = "VBOOv=6eadb043"; +char* VbootVersion = "VBOOv=fc764233"; |