Bruno Haible <[EMAIL PROTECTED]> writes: > 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.
I agree. An API with subtle issues like this is bound to cause problems. I've never encountered the problem in practice though, which seems strange given that this code has been tested on many platforms. /Simon -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]