From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 3/8] fit: add sha256 support
Date: Mon, 17 Feb 2014 07:33:30 +0100 [thread overview]
Message-ID: <5301AD3A.2050000@denx.de> (raw)
In-Reply-To: <CAPnjgZ2yAZXQW6MWAau9q=YxRGwvALaG7DwKUv=Sn75wEWbUjw@mail.gmail.com>
Hello Simon,
Am 15.02.2014 23:47, schrieb Simon Glass:
> Hi Heiko,
>
> On 8 February 2014 22:34, Heiko Schocher<hs@denx.de> wrote:
>> add sha256 support to fit images
>>
>> Signed-off-by: Heiko Schocher<hs@denx.de>
>> Acked-by: Simon Glass<sjg@chromium.org>
>
> Sorry I spotted a few things since.
No problem! Thanks for your review.
>> ---
>> changes for v2:
>> - add Acked-by from Simon Glass
>>
>> common/image-fit.c | 5 +++++
>> include/image.h | 9 +++++++++
>> lib/sha256.c | 2 +-
>> tools/Makefile | 3 +++
>> 4 files changed, 18 insertions(+), 1 deletion(-)
>>
[...]
>> diff --git a/include/image.h b/include/image.h
>> index 7de2bb2..f001a5f 100644
>> --- a/include/image.h
>> +++ b/include/image.h
>> @@ -57,13 +57,18 @@ struct lmb;
>> # ifdef CONFIG_SPL_SHA1_SUPPORT
>> # define IMAGE_ENABLE_SHA1 1
>> # endif
>> +# ifdef CONFIG_SPL_SHA256_SUPPORT
>> +# define IMAGE_ENABLE_SHA256 1
>> +# endif
>> # else
>> # define CONFIG_CRC32 /* FIT images need CRC32 support */
>> # define CONFIG_MD5 /* and MD5 */
>> # define CONFIG_SHA1 /* and SHA1 */
>> +# define CONFIG_SHA256 /* and SHA256 */
>
> Thinking about this again, I wonder if we want to force SHA256 to be
> enabled when FIT is used? Should we just hold the existing
> CONFIG_SHA256 setting in the board file and change:
I can do this, but why are the others fix?
>> # define IMAGE_ENABLE_CRC32 1
>> # define IMAGE_ENABLE_MD5 1
>> # define IMAGE_ENABLE_SHA1 1
>> +# define IMAGE_ENABLE_SHA256 1
>
> this to:
>
> #ifdef CONFIG_SHA256
> +# define IMAGE_ENABLE_SHA256 0
> #endif
>
> ?
Ok, changed, into:
#ifdef CONFIG_SHA256
# define IMAGE_ENABLE_SHA256 1
#endif
>> # endif
>>
>> #ifndef IMAGE_ENABLE_CRC32
>> @@ -78,6 +83,10 @@ struct lmb;
>> #define IMAGE_ENABLE_SHA1 0
>> #endif
>>
>> +#ifndef IMAGE_ENABLE_SHA256
>> +#define IMAGE_ENABLE_SHA256 0
>> +#endif
>> +
>> #endif /* CONFIG_FIT */
>>
>> #ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
>> diff --git a/lib/sha256.c b/lib/sha256.c
>> index 7348162..5766de2 100644
>> --- a/lib/sha256.c
>> +++ b/lib/sha256.c
>> @@ -258,7 +258,7 @@ void sha256_csum_wd(const unsigned char *input, unsigned int ilen,
>> {
>> sha256_context ctx;
>> #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
>> - unsigned char *end, *curr;
>> + const unsigned char *end, *curr;
>
> Why remove the const here?
I add const here ... I remve the "const" for the "curr" pointer.
>> int chunk;
>> #endif
>>
>> diff --git a/tools/Makefile b/tools/Makefile
>> index 328cea3..5e36e5e 100644
>> --- a/tools/Makefile
>> +++ b/tools/Makefile
>> @@ -71,6 +71,7 @@ EXT_OBJ_FILES-y += common/image-sig.o
>> EXT_OBJ_FILES-y += lib/crc32.o
>> EXT_OBJ_FILES-y += lib/md5.o
>> EXT_OBJ_FILES-y += lib/sha1.o
>> +EXT_OBJ_FILES-y += lib/sha256.o
>>
>> # Source files located in the tools directory
>> NOPED_OBJ_FILES-y += aisimage.o
>> @@ -223,6 +224,7 @@ $(obj)dumpimage$(SFX): $(obj)aisimage.o \
>> $(obj)os_support.o \
>> $(obj)pblimage.o \
>> $(obj)sha1.o \
>> + $(obj)sha256.o \
>> $(obj)ublimage.o \
>> $(LIBFDT_OBJS) \
>> $(RSA_OBJS)
>> @@ -252,6 +254,7 @@ $(obj)mkimage$(SFX): $(obj)aisimage.o \
>> $(obj)os_support.o \
>> $(obj)pblimage.o \
>> $(obj)sha1.o \
>> + $(obj)sha256.o \
>> $(obj)ublimage.o \
>> $(LIBFDT_OBJS) \
>> $(RSA_OBJS)
>> --
>> 1.8.3.1
>>
>> _______________________________________________
>> U-Boot mailing list
>> U-Boot at lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>
> Regards,
> Simon
>
>
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2014-02-17 6:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-09 5:34 [U-Boot] [PATCH v2 0/8] common, fit, rsa: enhancements Heiko Schocher
2014-02-09 5:34 ` [U-Boot] [PATCH v2 1/8] tools/image-host: fix sign-images bug Heiko Schocher
2014-02-09 5:34 ` [U-Boot] [PATCH v2 2/8] fdt: add "fdt checksign" command Heiko Schocher
2014-02-14 16:17 ` Simon Glass
2014-02-15 23:00 ` Simon Glass
2014-02-15 23:07 ` Simon Glass
2014-02-09 5:34 ` [U-Boot] [PATCH v2 3/8] fit: add sha256 support Heiko Schocher
2014-02-15 22:47 ` Simon Glass
2014-02-17 6:33 ` Heiko Schocher [this message]
2014-02-17 6:49 ` Heiko Schocher
2014-02-17 22:14 ` Simon Glass
2014-02-09 5:34 ` [U-Boot] [PATCH v2 4/8] rsa: add sha256-rsa2048 algorithm Heiko Schocher
2014-02-15 23:11 ` Simon Glass
2014-02-09 5:34 ` [U-Boot] [PATCH v2 5/8] rsa: add sha256,rsa4096 algorithm Heiko Schocher
2014-02-15 23:12 ` Simon Glass
2014-02-09 5:34 ` [U-Boot] [PATCH v2 6/8] gen: Add progressive hash API Heiko Schocher
2014-02-15 23:14 ` Simon Glass
2014-02-09 5:34 ` [U-Boot] [PATCH v2 7/8] tools, fit: add fit_info host command Heiko Schocher
2014-02-09 5:34 ` [U-Boot] [PATCH v2 8/8] tools, fit_check_sign: verify a signed fit image Heiko Schocher
2014-02-15 23:22 ` Simon Glass
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5301AD3A.2050000@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox