Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-05-09 00:25:09 +0300
committerJunio C Hamano <gitster@pobox.com>2020-05-09 00:25:09 +0300
commitb9bcd76a9a5373fe12f48490355d1a2021c0583f (patch)
tree823857d8f80f7885589f766cd523bf2e0c10dd4b /builtin
parent4c2941a5fa6c99cb204c48d2fe6f3b55a7211012 (diff)
parent3013118eb86f1c9e3d9b669bc23e770ee6e04174 (diff)
Merge branch 'cb/avoid-colliding-with-netbsd-hmac'
The <stdlib.h> header on NetBSD brings in its own definition of hmac() function (eek), which conflicts with our own and unrelated function with the same name. Our function has been renamed to work around the issue. * cb/avoid-colliding-with-netbsd-hmac: builtin/receive-pack: avoid generic function name hmac()
Diffstat (limited to 'builtin')
-rw-r--r--builtin/receive-pack.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index a00f91c1a0..d37ab776b3 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -418,7 +418,7 @@ static int copy_to_sideband(int in, int out, void *arg)
return 0;
}
-static void hmac(unsigned char *out,
+static void hmac_hash(unsigned char *out,
const char *key_in, size_t key_len,
const char *text, size_t text_len)
{
@@ -463,10 +463,10 @@ static char *prepare_push_cert_nonce(const char *path, timestamp_t stamp)
unsigned char hash[GIT_MAX_RAWSZ];
strbuf_addf(&buf, "%s:%"PRItime, path, stamp);
- hmac(hash, buf.buf, buf.len, cert_nonce_seed, strlen(cert_nonce_seed));
+ hmac_hash(hash, buf.buf, buf.len, cert_nonce_seed, strlen(cert_nonce_seed));
strbuf_release(&buf);
- /* RFC 2104 5. HMAC-SHA1-80 */
+ /* RFC 2104 5. HMAC-SHA1 or HMAC-SHA256 */
strbuf_addf(&buf, "%"PRItime"-%.*s", stamp, (int)the_hash_algo->hexsz, hash_to_hex(hash));
return strbuf_detach(&buf, NULL);
}