diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-02-07 19:46:54 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-02-07 19:47:25 +0100 |
commit | abfbff61efc4d91dc964eb2360760fa640ad0f0f (patch) | |
tree | fa525820b422eb6e524c7f554a6e82aeee80655f /gpg-interface.h | |
parent | Git 2.43 (diff) | |
download | git-abfbff61efc4d91dc964eb2360760fa640ad0f0f.tar.xz git-abfbff61efc4d91dc964eb2360760fa640ad0f0f.zip |
tag: fix sign_buffer() call to create a signed tag
The command "git tag -s" internally calls sign_buffer() to make a
cryptographic signature using the chosen backend like GPG and SSH.
The internal helper functions used by "git tag" implementation seem
to use a "negative return values are errors, zero or positive return
values are not" convention, and there are places (e.g., verify_tag()
that calls gpg_verify_tag()) that these internal helper functions
translate return values that signal errors to conform to this
convention, but do_sign() that calls sign_buffer() forgets to do so.
Fix it, so that a failed call to sign_buffer() that can return the
exit status from pipe_command() will not be overlooked.
Reported-by: Sergey Kosukhin <skosukhin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gpg-interface.h')
-rw-r--r-- | gpg-interface.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gpg-interface.h b/gpg-interface.h index 143cdc1c02..7cd98161f7 100644 --- a/gpg-interface.h +++ b/gpg-interface.h @@ -66,7 +66,7 @@ size_t parse_signed_buffer(const char *buf, size_t size); * Create a detached signature for the contents of "buffer" and append * it after "signature"; "buffer" and "signature" can be the same * strbuf instance, which would cause the detached signature appended - * at the end. + * at the end. Returns 0 on success, non-zero on failure. */ int sign_buffer(struct strbuf *buffer, struct strbuf *signature, const char *signing_key); |