[PATCH u-boot v2019.04-aspeed-openbmc 06/11] image-fit: use hashing infra
Joel Stanley
joel at jms.id.au
Wed Apr 14 09:49:35 AEST 2021
On Tue, 13 Apr 2021 at 12:38, Klaus Heinrich Kiwi
<klaus at linux.vnet.ibm.com> wrote:
>
>
>
> On 4/13/2021 5:07 AM, Joel Stanley wrote:
> > Signed-off-by: Joel Stanley <joel at jms.id.au>
> > ---
> > common/image-fit.c | 16 +++++++++++++++-
> > 1 file changed, 15 insertions(+), 1 deletion(-)
> >
> > diff --git a/common/image-fit.c b/common/image-fit.c
> > index e64949dfa73d..b9c3d79b83e1 100644
> > --- a/common/image-fit.c
> > +++ b/common/image-fit.c
> > @@ -1135,9 +1135,22 @@ int fit_set_timestamp(void *fit, int noffset, time_t timestamp)
> > * 0, on success
> > * -1, when algo is unsupported
> > */
> > -int calculate_hash(const void *data, int data_len, const char *algo,
> > +int calculate_hash(const void *data, int data_len, const char *algo_name,
> > uint8_t *value, int *value_len)
> Is the API changing here, or you just needed the 'algo' variable name for something else?
> Are all callers OK with that?
>
> > {
> > + struct hash_algo *algo;
> > +
> > + if (hash_lookup_algo(algo_name, &algo)) {
> > + debug("Unsupported hash alogrithm\n");
> > + return -1;
> > + }
> > +
> > + algo->hash_func_ws(data, data_len, value, algo->chunk_size);
> > + *value_len = algo->digest_size;
> > +
> > + return 0;
> > +
> > +#if 0
>
> Can you expand the rationale behind keeping this dead code around?
Good catch, I sent the wrong version of the patch. I'll send v2 with
the version that went upstream.
More information about the openbmc
mailing list