git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] builtin/receive-pack: avoid generic function name hmac()

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
May 5, 2020, 11:48 UTC
Message-ID
<20200505114837.GG6530@camp.crustytoothpaste.net>
In-Reply-To
<20200505095326.36374-1-carenas@gmail.com>
On 2020-05-05 at 09:53:26, Carlo Marcelo Arenas Belón wrote:
Show 21 quoted lines
> fabec2c5c3 (builtin/receive-pack: switch to use the_hash_algo, 2019-08-18)
> renames hmac_sha1 to hmac, as it was updated to use the hash function used
> by git (which won't be sha1 in the future).
> 
> hmac() is provided by NetBSD >= 8 libc and therefore conflicts as shown by :
> 
> builtin/receive-pack.c:421:13: error: conflicting types for 'hmac'
>  static void hmac(unsigned char *out,
>              ^~~~
> In file included from ./git-compat-util.h:172:0,
>                  from ./builtin.h:4,
>                  from builtin/receive-pack.c:1:
> /usr/include/stdlib.h:305:10: note: previous declaration of 'hmac' was here
>  ssize_t  hmac(const char *, const void *, size_t, const void *, size_t, void *,
>           ^~~~
> 
> Rename it again to hmac_hash to reflect it will use the git's defined hash
> function and avoid the conflict, while at it update a comment to better
> describe the HMAC function that was used.
> 
> Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Looks good.  Thanks again for the patch.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Carlo Marcelo Arenas Belón
Message 8 of 8 in “builtin/receive-pack: avoid generic function name hmac”
  1. builtin/receive-pack: avoid generic function name hmacCarlo Marcelo Arenas Belón, May 5, 2020
  2. Eric SunshineMay 5, 2020
  3. Junio C HamanoMay 5, 2020
  4. Carlo Marcelo Arenas BelónMay 5, 2020
  5. brian m. carlsonMay 5, 2020
  6. Carlo Marcelo Arenas BelónMay 5, 2020
  7. builtin/receive-pack: avoid generic function name hmac()Carlo Marcelo Arenas Belón, May 5, 2020
  8. brian m. carlsonMay 5, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.