builtin/receive-pack: switch to use the_hash_algo
commitfabec2c5c33b2623fe405c40ffcdeb838e97ed26
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sun, 18 Aug 2019 20:04:05 +0000 (18 20:04 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 19 Aug 2019 22:04:57 +0000 (19 15:04 -0700)
treeeb5e78e852cf489f63098c130df69ca876838ece
parentf6af19a9ad814de530bfac9b564126234434a9e3
builtin/receive-pack: switch to use the_hash_algo

The push cert code uses HMAC-SHA-1 to create a nonce.  This is a secure
use of SHA-1 which is not affected by its collision resistance (or lack
thereof).  However, it makes sense for us to use a better algorithm if
one is available, one which may even be more performant.  Futhermore,
until we have specialized functions for computing the hex value of an
arbitrary function, it simplifies the code greatly to use the same hash
algorithm everywhere.

Switch this code to use GIT_MAX_BLKSZ and the_hash_algo for computing
the push cert nonce, and rename the hmac_sha1 function to simply "hmac".

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/receive-pack.c