Skip to contentSkip to conversation

mkimage: Don't disable encryption based on CONFIG_FIT_CIPHER

PATCH In review Alexandru Gagniuc 2 participants 2 messages Aug 26, 2021 – Sep 30, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mkimage: Don't disable encryption based on CONFIG_FIT_CIPHER

We want the u-boot tools to be target agnostic, as explained in commit cb9faa6f98ae (" tools: Use a single target-independent config to enable OpenSSL")

Making mkimage features depend on CONFIG_FIT_CIPHER is contrary to that goal. Thus, always enable cihper features in mkimage, and ignore the value of CONFIG_FIT_CIPHER for host-only code.

---
 include/image.h    | 5 -----
 tools/image-host.c | 2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)
include/image.h +0 -5
index e20f0b69d5..381ee91eb5 100644
@@ -1432,14 +1432,9 @@ static inline int fit_image_check_target_arch(const void *fdt, int node)
  * device
  */
 #if defined(USE_HOSTCC)
-# if defined(CONFIG_FIT_CIPHER)
 #  define IMAGE_ENABLE_ENCRYPT	1
 #  define IMAGE_ENABLE_DECRYPT	1
 #  include <openssl/evp.h>
-# else
-#  define IMAGE_ENABLE_ENCRYPT	0
-#  define IMAGE_ENABLE_DECRYPT	0
-# endif
 #else
 # define IMAGE_ENABLE_ENCRYPT	0
 # define IMAGE_ENABLE_DECRYPT	CONFIG_IS_ENABLED(FIT_CIPHER)
tools/image-host.c +1 -1
index d3a882ec29..82cb238f54 100644
@@ -562,7 +562,7 @@ int fit_image_cipher_data(const char *keydir, void *keydest,
 		printf("Failure getting cipher node\n");
 		return -1;
 	}
-	if (!IMAGE_ENABLE_ENCRYPT || !keydir)
+	if (keydir)
 		return 0;
 	return fit_image_process_cipher(keydir, keydest, fit, image_name,
 		image_noffset, cipher_node_offset, data, size, cmdname);
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Alexandru Gagniuc

We want the u-boot tools to be target agnostic, as explained in commit cb9faa6f98ae (" tools: Use a single target-independent config to enable OpenSSL")

Making mkimage features depend on CONFIG_FIT_CIPHER is contrary to that goal. Thus, always enable cihper features in mkimage, and ignore the value of CONFIG_FIT_CIPHER for host-only code.

Quoted 5 lines
---
 include/image.h    | 5 -----
 tools/image-host.c | 2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)

This is removed also by my recent part B series.