bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Alignment issue with sha1 code from gnulib


From: Bruno Haible
Subject: Re: Alignment issue with sha1 code from gnulib
Date: Thu, 31 Jan 2008 00:15:56 +0100
User-agent: KMail/1.5.4

Jim Meyering wrote:
> Thanks for the suggestion.  It looks like a good one.

The suggestion also applies to the 'md5' module, after which the 'sha1' module
is modeled.

But if you apply the suggestion to both the sha1 and md5 modules, we get
an additional difference to glibc code.

OTOH, Simon himself fell into the pitfall at every usage of these functions:
  - In lib/hmac-sha1.c, the arrays optkeybuf and innerhash are not aligned.
  - Likewise for lib/hmac-md5.c.
  - In lib/hmac.h, the documentation of both functions fails to mention the
    alignment requirement for the RESBUF argument.
  - In lib/gc.h, the declaration of gc_hash_buffer, gc_hmac_md5 and gc_hmac_sha1
    also fails to mention the alignment requirement.
And gc_hash_buffer is a function to be used by applications. So there are
surely more occurrences of the problem.

All in all, I think it's worth fixing this, even at the cost of diverging from
glibc.

Bruno






reply via email to

[Prev in Thread] Current Thread [Next in Thread]