summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJi Luo <ji.luo@nxp.com>2020-06-16 19:17:05 +0800
committerJi Luo <ji.luo@nxp.com>2020-06-17 17:10:28 +0800
commit4030462cb99e1dc67f7ee28f391ddd5c21938878 (patch)
tree4d5c021dc1d8509e52daf525479769843ca6f894 /lib
parentb16fc52cf9a9ea4d63bced50b949d0bc2328ddea (diff)
MA-17363-1 Enable trusty for xen
Trusty binary will be integrated into the dom0 bootloader, need to check rpmb keyslot for trusty. Use software sha256 calculation method in avb verify as we still have issues to use physical address in domu bootloader. Test: boots xen with android. Signed-off-by: Ji Luo <ji.luo@nxp.com> Change-Id: Ie7da9196ad6947157111665efd420bf4381385d6
Diffstat (limited to 'lib')
-rw-r--r--lib/libavb/avb_slot_verify.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libavb/avb_slot_verify.c b/lib/libavb/avb_slot_verify.c
index 63b80711ac..900b2ebf53 100644
--- a/lib/libavb/avb_slot_verify.c
+++ b/lib/libavb/avb_slot_verify.c
@@ -15,7 +15,7 @@
#include "avb_vbmeta_image.h"
#include "avb_version.h"
#include <malloc.h>
-#if defined(CONFIG_IMX_TRUSTY_OS) && !defined(CONFIG_AVB_ATX)
+#if defined(CONFIG_IMX_TRUSTY_OS) && !defined(CONFIG_AVB_ATX) && !defined(CONFIG_XEN)
#include "trusty/hwcrypto.h"
#include <memalign.h>
#endif
@@ -299,7 +299,7 @@ static AvbSlotVerifyResult load_and_verify_hash_partition(
size_t expected_digest_len = 0;
uint8_t expected_digest_buf[AVB_SHA512_DIGEST_SIZE];
const uint8_t* expected_digest = NULL;
-#if defined(CONFIG_IMX_TRUSTY_OS) && !defined(CONFIG_AVB_ATX)
+#if defined(CONFIG_IMX_TRUSTY_OS) && !defined(CONFIG_AVB_ATX) && !defined(CONFIG_XEN)
uint8_t* hash_out = NULL;
uint8_t* hash_buf = NULL;
#endif
@@ -403,7 +403,7 @@ static AvbSlotVerifyResult load_and_verify_hash_partition(
image_size_to_hash = image_size;
}
if (avb_strcmp((const char*)hash_desc.hash_algorithm, "sha256") == 0) {
-#if defined(CONFIG_IMX_TRUSTY_OS) && !defined(CONFIG_AVB_ATX)
+#if defined(CONFIG_IMX_TRUSTY_OS) && !defined(CONFIG_AVB_ATX) && !defined(CONFIG_XEN)
/* DMA requires cache aligned input/output buffer */
hash_out = memalign(ARCH_DMA_MINALIGN, AVB_SHA256_DIGEST_SIZE);
if (hash_out == NULL) {
@@ -488,7 +488,7 @@ static AvbSlotVerifyResult load_and_verify_hash_partition(
out:
-#if defined(CONFIG_IMX_TRUSTY_OS) && !defined(CONFIG_AVB_ATX)
+#if defined(CONFIG_IMX_TRUSTY_OS) && !defined(CONFIG_AVB_ATX) && !defined(CONFIG_XEN)
if (hash_out != NULL) {
free(hash_out);
hash_out = NULL;