[PATCH 1/2] hmac-sha512: fix hash for keys > blocksize (128 bytes)

2018-09-29 Thread Pádraig Brady
* lib/hmac-sha512.c (hmac_sha512): Set the computed/shortened key length to that output by sha512, not the blocksize. Otherwise uninitialized data from the stack is used when computing the hash. * tests/test-hmac-sha512.c: Add a shortened key test case. Reported at https://github.com/coreutils/gnul

[PATCH 2/2] hmac-*: refactor to remove repetitive code

2018-09-29 Thread Pádraig Brady
A net removal of 240 lines. * lib/hmac.c: A new parameterized single implementation. * lib/hmac-md5.c: Define parameters and include implementation. * lib/hmac-sha1.c: Likewise. * lib/hmac-sha256.c: Likewise. * lib/hmac-sha512.c: Likewise. * modules/crypto/hmac-md5: Reference the new implementatio

Re: [bug #33724] Find command is changing the access time of directory

2018-09-29 Thread Paul Eggert
Bernhard Voelker wrote: So regarding gnulib, there are 2 alternatives: a) rename FTS_NOATIME to FTS_NOATIME, and add a retry to open/openat in each place when that was using O_NOATIME and we got EPERM. I didn't quite get the point of the rename; those two identifiers look identical to me. T

timevar: further work

2018-09-29 Thread Bruno Haible
Hi Akim, - Unclear comments: timevar_enabled: When does it need to be set? Before or after init_timevar() is called? - Portability: According to the Gnulib documentation, 'times' is missing on native Windows (mingw, MSVC). The Gnulib module 'times' has a replacement for it, that is better t

timevar: small tweaks

2018-09-29 Thread Bruno Haible
Hi Akim, How about the following patches: * In timevar.c: Include timevar.h first. This is a Gnulib best practice, which has the benefit of verifying that the header file is self-contained. * In timevar.def: - The DEFTIMEVAR invocation must NOT be followed by a semicolon, otherwise you'l

timevar: documentation

2018-09-29 Thread Bruno Haible
Hi Akim, How about the following patch to: - include timevar.texi in the Gnulib documentation, - mention '#include ', needed for stderr, - use GNU coding style for function definitions, - use #include "work.h". The common practice is to use #include <> for header files defined outside the packag

Re: [bug #33724] Find command is changing the access time of directory

2018-09-29 Thread James Youngman
Re-reading the text I wrote, I see that some critical words were missing: > Reserving the option doesn't seem especially helpful, either I meant, reserving the option as being for use only by the root user (for whom one might imagine the EPERM issue would not arise) does not seem especially helpf

Re: [bug #33724] Find command is changing the access time of directory

2018-09-29 Thread Bernhard Voelker
On 9/29/18 9:30 AM, James Youngman wrote: > Having a "don't update atime" option that only works sometimes (when I > own the directory) seems problematic to me. > > If the user specifies the "keep access time unchanged" option and we > can't honour it (because there is at least one directory that

Re: Would timevar be accepted in gnulib?

2018-09-29 Thread Bruno Haible
Hi Akim, > Here is my initial proposal for timevar in gnulib. Thanks! The code looks well-commented now. I pushed it for you, after completing the ChangeLog entry. Bruno

Re: [bug #33724] Find command is changing the access time of directory

2018-09-29 Thread James Youngman
Having a "don't update atime" option that only works sometimes (when I own the directory) seems problematic to me. If the user specifies the "keep access time unchanged" option and we can't honour it (because there is at least one directory that they don't own) what should we do? We can't simply