diff options
author | Brian Gernhardt <brian@gernhardtsoftware.com> | 2014-09-25 11:02:20 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-09-25 11:12:57 -0700 |
commit | 6f5ef44e0d8933621fcd50127518557013002313 (patch) | |
tree | a9037d2292a03daf460a22ae1c58db435928821a /builtin | |
parent | signed push: allow stale nonce in stateless mode (diff) | |
download | tgif-6f5ef44e0d8933621fcd50127518557013002313.tar.xz |
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>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/receive-pack.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index efb13b1134..42f25a5103 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -288,7 +288,7 @@ static int copy_to_sideband(int in, int out, void *arg) #define HMAC_BLOCK_SIZE 64 -static void hmac_sha1(unsigned char out[20], +static void hmac_sha1(unsigned char *out, const char *key_in, size_t key_len, const char *text, size_t text_len) { @@ -323,7 +323,7 @@ static void hmac_sha1(unsigned char out[20], /* RFC 2104 2. (6) & (7) */ git_SHA1_Init(&ctx); git_SHA1_Update(&ctx, k_opad, sizeof(k_opad)); - git_SHA1_Update(&ctx, out, sizeof(out)); + git_SHA1_Update(&ctx, out, 20); git_SHA1_Final(out, &ctx); } |