receive-pack::hmac_sha1(): copy the entire SHA-1 hash out
[gitweb.git] / builtin / receive-pack.c
index efb13b11343b29a925a985911a31c988bfbc33cf..42f25a5103a72486c46d7b3a584f249495dc12b4 100644 (file)
@@ -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);
 }