diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2018-05-02 00:25:53 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-02 13:59:51 +0900 |
commit | f6d27d2468ccf8e123f9bffde6466d673dba2317 (patch) | |
tree | e6eb115145535ec016c3fcde713ff96d00c0a567 /decorate.h | |
parent | diff: specify abbreviation size in terms of the_hash_algo (diff) | |
download | tgif-f6d27d2468ccf8e123f9bffde6466d673dba2317.tar.xz |
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 <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'decorate.h')
0 files changed, 0 insertions, 0 deletions