Fix compiler errors on MSVC

Change-Id: I47fd6d0be5542e5f540a34410b3f694ae0f67fd9

R=gauravsh@chromium.org
BUG=none
TEST=make && make runtests

Review URL: http://codereview.chromium.org/6676039
This commit is contained in:
Randall Spangler
2011-03-16 09:56:15 -07:00
parent b6a29ad339
commit 4c6e6dac28
3 changed files with 7 additions and 7 deletions

View File

@@ -354,7 +354,6 @@ uint32_t RollbackFirmwareLock(void) {
uint32_t RollbackKernelRecovery(int developer_mode) {
uint32_t rvs, rve;
RollbackSpaceFirmware rsf;
uint8_t out_digest[20]; /* For PCR extend output */
/* In recovery mode we ignore TPM malfunctions or corruptions, and *
* leave the TPM complelely unlocked; we call neither

View File

@@ -28,7 +28,8 @@
* 7 Normal-signed firmware | 1
* (anything else) | 0
*/
const uint8_t kBootStateSHA1Digests[][20] = {
const char* kBootStateSHA1Digests[] = {
/* SHA1("\x00\x00\x00") */
"\x29\xe2\xdc\xfb\xb1\x6f\x63\xbb\x02\x54\xdf\x75\x85\xa1\x5b\xb6"
"\xfb\x5e\x92\x7d",
@@ -78,11 +79,11 @@ const uint8_t kBootStateSHA1Digests[][20] = {
"\xbf\x35\x31\x78",
};
#define MAX_BOOT_STATE_INDEX (sizeof(kBootStateSHA1Digests)/sizeof(char[20]))
#define MAX_BOOT_STATE_INDEX (sizeof(kBootStateSHA1Digests)/sizeof(char*))
/* Used for PCR extend when the passed-in boot state is invalid or
* if there is an internal error. */
const uint8_t kBootInvalidSHA1Digest[20] = {
const uint8_t kBootInvalidSHA1Digest[] = {
"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff"
"\xff\xff\xff\xff"
};
@@ -123,7 +124,7 @@ uint32_t SetTPMBootModeState(int developer_mode, int recovery_mode,
fw_keyblock_flags);
if (digest_index >= 0 && digest_index < MAX_BOOT_STATE_INDEX)
in_digest = kBootStateSHA1Digests[digest_index];
in_digest = (const uint8_t*)kBootStateSHA1Digests[digest_index];
else
in_digest = kBootInvalidSHA1Digest; /* Internal out of bounds error. */
result = TlclExtend(BOOT_MODE_PCR, in_digest, out_digest);

View File

@@ -54,7 +54,7 @@ int LoadFirmware(LoadFirmwareParams* params) {
uint32_t status;
uint32_t test_err = 0;
int good_index = -1;
int boot_fw_keyblock_flags = 0;
uint64_t boot_fw_keyblock_flags = 0;
int is_dev;
int index;
int i;
@@ -292,7 +292,7 @@ int LoadFirmware(LoadFirmwareParams* params) {
/* At this point, we have a good idea of how we are going to boot. Update the
* TPM with this state information.
*/
status = SetTPMBootModeState(is_dev, 0, boot_fw_keyblock_flags);
status = SetTPMBootModeState(is_dev, 0, (int)boot_fw_keyblock_flags);
if (0 != status) {
VBDEBUG(("Unable to update the TPM with boot mode information.\n"));
if (status == TPM_E_MUST_REBOOT)