Skip to content

Commit 07fa383

Browse files
committed
Merge branch 'jc/sign-buffer-failure-propagation-fix' into maint-2.43
A failed "git tag -s" did not necessarily result in an error depending on the crypto backend, which has been corrected. * jc/sign-buffer-failure-propagation-fix: ssh signing: signal an error with a negative return value tag: fix sign_buffer() call to create a signed tag
2 parents a1cd814 + 6931049 commit 07fa383

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

builtin/tag.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static int verify_tag(const char *name, const char *ref UNUSED,
175175

176176
static int do_sign(struct strbuf *buffer)
177177
{
178-
return sign_buffer(buffer, buffer, get_signing_key());
178+
return sign_buffer(buffer, buffer, get_signing_key()) ? -1 : 0;
179179
}
180180

181181
static const char tag_template[] =

gpg-interface.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ static int sign_buffer_ssh(struct strbuf *buffer, struct strbuf *signature,
10781078
if (strstr(signer_stderr.buf, "usage:"))
10791079
error(_("ssh-keygen -Y sign is needed for ssh signing (available in openssh version 8.2p1+)"));
10801080

1081-
error("%s", signer_stderr.buf);
1081+
ret = error("%s", signer_stderr.buf);
10821082
goto out;
10831083
}
10841084

gpg-interface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ size_t parse_signed_buffer(const char *buf, size_t size);
6666
* Create a detached signature for the contents of "buffer" and append
6767
* it after "signature"; "buffer" and "signature" can be the same
6868
* strbuf instance, which would cause the detached signature appended
69-
* at the end.
69+
* at the end. Returns 0 on success, non-zero on failure.
7070
*/
7171
int sign_buffer(struct strbuf *buffer, struct strbuf *signature,
7272
const char *signing_key);

0 commit comments

Comments
 (0)