mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-25 01:07:22 +00:00
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:
@@ -354,7 +354,6 @@ uint32_t RollbackFirmwareLock(void) {
|
|||||||
uint32_t RollbackKernelRecovery(int developer_mode) {
|
uint32_t RollbackKernelRecovery(int developer_mode) {
|
||||||
uint32_t rvs, rve;
|
uint32_t rvs, rve;
|
||||||
RollbackSpaceFirmware rsf;
|
RollbackSpaceFirmware rsf;
|
||||||
uint8_t out_digest[20]; /* For PCR extend output */
|
|
||||||
|
|
||||||
/* In recovery mode we ignore TPM malfunctions or corruptions, and *
|
/* In recovery mode we ignore TPM malfunctions or corruptions, and *
|
||||||
* leave the TPM complelely unlocked; we call neither
|
* leave the TPM complelely unlocked; we call neither
|
||||||
|
|||||||
@@ -28,7 +28,8 @@
|
|||||||
* 7 Normal-signed firmware | 1
|
* 7 Normal-signed firmware | 1
|
||||||
* (anything else) | 0
|
* (anything else) | 0
|
||||||
*/
|
*/
|
||||||
const uint8_t kBootStateSHA1Digests[][20] = {
|
|
||||||
|
const char* kBootStateSHA1Digests[] = {
|
||||||
/* SHA1("\x00\x00\x00") */
|
/* SHA1("\x00\x00\x00") */
|
||||||
"\x29\xe2\xdc\xfb\xb1\x6f\x63\xbb\x02\x54\xdf\x75\x85\xa1\x5b\xb6"
|
"\x29\xe2\xdc\xfb\xb1\x6f\x63\xbb\x02\x54\xdf\x75\x85\xa1\x5b\xb6"
|
||||||
"\xfb\x5e\x92\x7d",
|
"\xfb\x5e\x92\x7d",
|
||||||
@@ -78,11 +79,11 @@ const uint8_t kBootStateSHA1Digests[][20] = {
|
|||||||
"\xbf\x35\x31\x78",
|
"\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
|
/* Used for PCR extend when the passed-in boot state is invalid or
|
||||||
* if there is an internal error. */
|
* 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\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);
|
fw_keyblock_flags);
|
||||||
|
|
||||||
if (digest_index >= 0 && digest_index < MAX_BOOT_STATE_INDEX)
|
if (digest_index >= 0 && digest_index < MAX_BOOT_STATE_INDEX)
|
||||||
in_digest = kBootStateSHA1Digests[digest_index];
|
in_digest = (const uint8_t*)kBootStateSHA1Digests[digest_index];
|
||||||
else
|
else
|
||||||
in_digest = kBootInvalidSHA1Digest; /* Internal out of bounds error. */
|
in_digest = kBootInvalidSHA1Digest; /* Internal out of bounds error. */
|
||||||
result = TlclExtend(BOOT_MODE_PCR, in_digest, out_digest);
|
result = TlclExtend(BOOT_MODE_PCR, in_digest, out_digest);
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ int LoadFirmware(LoadFirmwareParams* params) {
|
|||||||
uint32_t status;
|
uint32_t status;
|
||||||
uint32_t test_err = 0;
|
uint32_t test_err = 0;
|
||||||
int good_index = -1;
|
int good_index = -1;
|
||||||
int boot_fw_keyblock_flags = 0;
|
uint64_t boot_fw_keyblock_flags = 0;
|
||||||
int is_dev;
|
int is_dev;
|
||||||
int index;
|
int index;
|
||||||
int i;
|
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
|
/* At this point, we have a good idea of how we are going to boot. Update the
|
||||||
* TPM with this state information.
|
* 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) {
|
if (0 != status) {
|
||||||
VBDEBUG(("Unable to update the TPM with boot mode information.\n"));
|
VBDEBUG(("Unable to update the TPM with boot mode information.\n"));
|
||||||
if (status == TPM_E_MUST_REBOOT)
|
if (status == TPM_E_MUST_REBOOT)
|
||||||
|
|||||||
Reference in New Issue
Block a user