#include "u-boot/sha256.h"
#include <trusty/libtipc.h>
#include <trusty/hwcrypto.h>
+
+#ifndef CONFIG_LOAD_KEY_FROM_RPMB
+#include "../lib/avb/fsl/fsl_public_key.h"
+#endif
+
#endif
#include "fb_fsl_common.h"
}
#else
uint8_t public_key_buf[AVB_MAX_BUFFER_LENGTH];
+#ifdef CONFIG_LOAD_KEY_FROM_RPMB
if (trusty_read_vbmeta_public_key(public_key_buf,
AVB_MAX_BUFFER_LENGTH) != 0) {
printf("ERROR - failed to read public key for keymaster\n");
memset(boot_key_hash, '\0', AVB_SHA256_DIGEST_SIZE);
} else
+#else
+ memcpy(public_key_buf, fsl_public_key, AVB_SHA256_DIGEST_SIZE);
+#endif
sha256_csum_wd((unsigned char *)public_key_buf, AVB_SHA256_DIGEST_SIZE,
(unsigned char *)boot_key_hash, CHUNKSZ_SHA256);
#endif
#ifndef __FSL_PUBLIC_KEY_H_
#define __FSL_PUBLIC_KEY_H_
/*This public key is generated from testkey_rsa4096.pem.*/
-unsigned char fsl_public_key[] = {
+static unsigned char fsl_public_key[] = {
0x00,0x00,0x10,0x00,0x55,0xd9,0x04,0xad,
0xd8,0x04,0xaf,0xe3,0xd3,0x84,0x6c,0x7e,
0x0d,0x89,0x3d,0xc2,0x8c,0xd3,0x12,0x55,