Commit 23862672 authored by Salome Thirot's avatar Salome Thirot Committed by Andrzej Puzdrowski
Browse files

boot: Fix IS_ENCRYPTED macro definition



The previous definition did not work as setting any type of flag would
make IS_ENCRYPTED true.

Signed-off-by: default avatarSalome Thirot <salome.thirot@arm.com>
parent 082be24c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -149,8 +149,8 @@ struct image_tlv {
    uint16_t it_len;    /* Data length (not including TLV header). */
};

#define IS_ENCRYPTED(hdr) (((hdr)->ih_flags && IMAGE_F_ENCRYPTED_AES128) \
                        || ((hdr)->ih_flags && IMAGE_F_ENCRYPTED_AES256))
#define IS_ENCRYPTED(hdr) (((hdr)->ih_flags & IMAGE_F_ENCRYPTED_AES128) \
                        || ((hdr)->ih_flags & IMAGE_F_ENCRYPTED_AES256))
#define MUST_DECRYPT(fap, idx, hdr) \
    (flash_area_get_id(fap) == FLASH_AREA_IMAGE_SECONDARY(idx) && IS_ENCRYPTED(hdr))