mirror of https://github.com/wolfSSL/wolfBoot.git
Fix build errors
parent
5b0e8ed00c
commit
b6b46e4d05
16
src/tpm.c
16
src/tpm.c
|
|
@ -32,7 +32,6 @@
|
|||
#include "spi_drv.h"
|
||||
#include "tpm.h"
|
||||
#include "wolftpm/tpm2_tis.h" /* for TIS header size and wait state */
|
||||
#include <wolfssl/wolfcrypt/misc.h>
|
||||
|
||||
WOLFTPM2_DEV wolftpm_dev;
|
||||
#if defined(WOLFBOOT_TPM_KEYSTORE) || defined(WOLFBOOT_TPM_SEAL)
|
||||
|
|
@ -45,6 +44,19 @@ WOLFTPM2_KEY wolftpm_srk;
|
|||
#endif
|
||||
|
||||
#if defined(WOLFBOOT_TPM_SEAL) || defined(WOLFBOOT_TPM_KEYSTORE)
|
||||
static int wolfBoot_constant_compare(const uint8_t* a, const uint8_t* b,
|
||||
uint32_t len)
|
||||
{
|
||||
uint32_t i;
|
||||
uint8_t diff = 0;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
diff |= a[i] ^ b[i];
|
||||
}
|
||||
|
||||
return diff;
|
||||
}
|
||||
|
||||
void wolfBoot_print_hexstr(const unsigned char* bin, unsigned long sz,
|
||||
unsigned long maxLine)
|
||||
{
|
||||
|
|
@ -1516,7 +1528,7 @@ int wolfBoot_check_rot(int key_slot, uint8_t* pubkey_hint)
|
|||
if (rc == 0) {
|
||||
/* verify the hint (hash) matches */
|
||||
if (digestSz == WOLFBOOT_SHA_DIGEST_SIZE &&
|
||||
ConstantCompare(digest, pubkey_hint,
|
||||
wolfBoot_constant_compare(digest, pubkey_hint,
|
||||
WOLFBOOT_SHA_DIGEST_SIZE) == 0) {
|
||||
wolfBoot_printf("TPM Root of Trust valid (id %d)\n", key_slot);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -178,7 +178,8 @@ $(LSCRIPT): $(LSCRIPT_IN) FORCE
|
|||
sed -e "s/@WOLFBOOT_DTS_BOOT_ADDRESS@/$(WOLFBOOT_DTS_BOOT_ADDRESS)/g" | \
|
||||
sed -e "s/@WOLFBOOT_DTS_UPDATE_ADDRESS@/$(WOLFBOOT_DTS_UPDATE_ADDRESS)/g" | \
|
||||
sed -e "s/@WOLFBOOT_LOAD_ADDRESS@/$(WOLFBOOT_LOAD_ADDRESS)/g" | \
|
||||
sed -e "s/@WOLFBOOT_LOAD_DTS_ADDRESS@/$(WOLFBOOT_LOAD_DTS_ADDRESS)/g" \
|
||||
sed -e "s/@WOLFBOOT_LOAD_DTS_ADDRESS@/$(WOLFBOOT_LOAD_DTS_ADDRESS)/g" | \
|
||||
sed -e "s|@WOLFBOOT_RAMBOOT_MAX_SIZE_DEFINE@|$(if $(strip $(WOLFBOOT_RAMBOOT_MAX_SIZE)),#define WOLFBOOT_RAMBOOT_MAX_SIZE $(WOLFBOOT_RAMBOOT_MAX_SIZE),/* WOLFBOOT_RAMBOOT_MAX_SIZE undefined */)|g" \
|
||||
> $@
|
||||
|
||||
$(BUILD_DIR)/%.o: %.c
|
||||
|
|
|
|||
Loading…
Reference in New Issue