From: brian m. carlson Date: Wed, 2 May 2018 00:25:53 +0000 (+0000) Subject: builtin/receive-pack: avoid hard-coded constants for push certs X-Git-Tag: v2.18.0-rc0~17^2~17 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/f6d27d2468ccf8e123f9bffde6466d673dba2317?hp=f6d27d2468ccf8e123f9bffde6466d673dba2317 builtin/receive-pack: avoid hard-coded constants for push certs Use the GIT_SHA1_RAWSZ and GIT_SHA1_HEXSZ macros instead of hard-coding the constants 20 and 40. Switch one use of 20 with a format specifier for a hex value to use the hex constant instead, as the original appears to have been a typo. At this point, avoid converting the hard-coded use of SHA-1 to use the_hash_algo. SHA-1, even if not collision resistant, is secure in the context in which it is used here, and the hash algorithm of the repo need not match what is used here. When we adopt a new hash algorithm, we can simply adopt the new algorithm wholesale here, as the nonce is opaque and its length and validity are entirely controlled by the server. Consequently, defer updating this code until that point. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano ---