[PATCH 0/9 v3] digest: allow multiple implementation of digest
Jean-Christophe PLAGNIOL-VILLARD
plagnioj at jcrosoft.com
Tue Mar 31 10:33:26 PDT 2015
> On Mar 31, 2015, at 11:44 PM, Antony Pavlov <antonynpavlov at gmail.com> wrote:
>
> On Wed, 25 Mar 2015 12:51:40 +0100
> Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com> wrote:
>
> Hmmm.
>
> This new digest implementation have some Kconfig inconsistency.
>
> E.g. I can configure barebox like this:
>
> CONFIG_CMD_SHA1SUM=y
> ...
> CONFIG_SHA1=y
> # CONFIG_DIGEST_MD5_GENERIC is not set
> # CONFIG_DIGEST_SHA1_GENERIC is not set
> # CONFIG_DIGEST_SHA224_GENERIC is not set
> # CONFIG_DIGEST_SHA256_GENERIC is not set
> # CONFIG_DIGEST_SHA384_GENERIC is not set
> # CONFIG_DIGEST_SHA512_GENERIC is not set
> # CONFIG_DIGEST_HMAC_GENERIC is not set
>
> And here is BUG log for this configuration:
normal you select none of the implementation
you have to select one it’s your choice which one generic vs asm or hard if implemented
>
> barebox:/ sha1sum foobar
> BUG: failure at commands/hashsum.c:61/do_hash()!
> BUG!
> no stack data available
>
> Could we tune Kconfig somehow (e.g. add addition dependencies) to prevent situations like this?
yes buy inverting the dependancy, no need a new one
SHA1 means we have at least one SHA1 implementation enabled
I would even drop the hashsum command for the new digest command as you will have less impact
in term of binary size and more features.
Best Regards,
J.
More information about the barebox
mailing list