]> git.ipfire.org Git - thirdparty/git.git/commit
tag: sign both hashes
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 2 Oct 2023 02:40:16 +0000 (21:40 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 Oct 2023 21:57:39 +0000 (14:57 -0700)
commit867386d0c8aa0ea9edb683585b69b20f96c4f776
tree9abcdd3f873d4625337cca1dac2283f6b36eebdf
parent6bcc5fa20d960c86a58248e66481c1c57155cca6
tag: sign both hashes

When we write a tag the object oid is specific to the hash algorithm.

This matters when a tag is signed.  The hash transition plan calls for
signatures on both the sha1 form and the sha256 form of the object,
and for both of those signatures to live in the tag object.

To generate tag object with multiple signatures, first compute the
unsigned form of the tag, and then if the tag is being signed compute
the unsigned form of the tag with the compatibilityr hash.  Then
compute compute the signatures of both buffers.

Once the signatures are computed add them to both buffers.  This
allows computing the compatibility hash in do_sign, saving
write_object_file the expense of recomputing the compatibility tag
just to compute it's hash.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/tag.c