[PATCH 2/3] image-cipher: Fix FIT_CIPHER linking

Joel Stanley joel at jms.id.au
Tue Dec 8 04:24:15 CET 2020


On Mon, 7 Dec 2020 at 17:07, Philippe REYNES
<philippe.reynes at softathome.com> wrote:
>
> Hi Joel,
>
> sorry for this very late answer ..
>
>
> This patch fix this issue when only the ciphering is enabled.
> But it breaks the compilation when signature and ciphering are
> enabled, because both functions image_set_host_blob and
> image_get_host_blob are defined twice.
> So it is a NAK for me.
>
> A simple way to fix it to move this block of code from image-fit-sig.c
> to iamge-fit.c

Agreed, that is a better idea.

I'll send a v2.

>
> Regards,
> Philippe
>
>
> Le 11/11/2020 à 12:18, Joel Stanley a écrit :
> > When CONFIG_FIT_CIPHER=y and CONFIG_FIT_SIGNATURE=n is there is no
> > implementation of image_get_host_blob for mkimage or dumpimage:
> >
> >   /usr/bin/ld: tools/common/image-cipher.o: in function `fit_image_decrypt_data':
> >   image-cipher.c:(.text+0x9a): undefined reference to `image_get_host_blob'
> >
> > The implementation is the same as common/image-fit-sig.c.
> >
> > Signed-off-by: Joel Stanley <joel at jms.id.au>
> > ---
> >   common/image-cipher.c | 14 ++++++++++++++
> >   1 file changed, 14 insertions(+)
> >
> > diff --git a/common/image-cipher.c b/common/image-cipher.c
> > index 4ca9eec4ef15..fcbbceb847a5 100644
> > --- a/common/image-cipher.c
> > +++ b/common/image-cipher.c
> > @@ -15,6 +15,20 @@ DECLARE_GLOBAL_DATA_PTR;
> >   #include <uboot_aes.h>
> >   #include <u-boot/aes.h>
> >
> > +#ifdef USE_HOSTCC
> > +void *host_blob;
> > +
> > +void image_set_host_blob(void *blob)
> > +{
> > +     host_blob = blob;
> > +}
> > +
> > +void *image_get_host_blob(void)
> > +{
> > +     return host_blob;
> > +}
> > +#endif
> > +
> >   struct cipher_algo cipher_algos[] = {
> >       {
> >               .name = "aes128",


More information about the U-Boot mailing list