receive-pack::hmac_sha1(): copy the entire SHA-1 hash out
clang gives the following warning: builtin/receive-pack.c:327:35: error: sizeof on array function parameter will return size of 'unsigned char *' instead of 'unsigned char [20]' [-Werror,-Wsizeof-array-argument] git_SHA1_Update(&ctx, out, sizeof(out)); ^ builtin/receive-pack.c:292:37: note: declared here static void hmac_sha1(unsigned char out[20], ^ Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brian Gernhardt committed
Sep 25, 2014 at 11:02 UTC
6f5ef44e0d8933621fcd50127518557013002313
1 file changed
+2
-2
builtin/receive-pack.c
+2
-2
@@ -288,7 +288,7 @@ static int copy_to_sideband(int in, int out, void *arg)
288
289
#define HMAC_BLOCK_SIZE 64
290
291
-static void hmac_sha1(unsigned char out[20],
291
+static void hmac_sha1(unsigned char *out,
292
const char *key_in, size_t key_len,
293
const char *text, size_t text_len)
294
{
@@ -323,7 +323,7 @@ static void hmac_sha1(unsigned char out[20],
323
/* RFC 2104 2. (6) & (7) */
324
git_SHA1_Init(&ctx);
325
git_SHA1_Update(&ctx, k_opad, sizeof(k_opad));
326
- git_SHA1_Update(&ctx, out, sizeof(out));
326
+ git_SHA1_Update(&ctx, out, 20);
327
git_SHA1_Final(out, &ctx);
328
}
329