[PATCH] 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.
Signed-off-by: Alexandru Gagniuc mr.nuke.me@gmail.com --- include/image.h | 5 ----- tools/image-host.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/include/image.h b/include/image.h index e20f0b69d5..381ee91eb5 100644 --- a/include/image.h +++ b/include/image.h @@ -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) diff --git a/tools/image-host.c b/tools/image-host.c index d3a882ec29..82cb238f54 100644 --- a/tools/image-host.c +++ b/tools/image-host.c @@ -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);

On Thu, 26 Aug 2021 at 15:55, Alexandru Gagniuc mr.nuke.me@gmail.com wrote:
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.
Signed-off-by: Alexandru Gagniuc mr.nuke.me@gmail.com
include/image.h | 5 ----- tools/image-host.c | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org
This is removed also by my recent part B series.
participants (2)
-
Alexandru Gagniuc
-
Simon Glass