summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-03-27 00:11:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-03-27 00:11:20 (GMT)
commitfa82be982dfc5b463a125991a2d381f1cd0ad9eb (patch)
tree6e67608a69b0c1a51a540c3c70e0b03c25646fd1 /builtin
parentf8cb64e3d4d512a86c1b7b3aa584f11740b3d038 (diff)
parent67948981983b336eab2fa7e6a0e125d529391dfc (diff)
downloadgit-fa82be982dfc5b463a125991a2d381f1cd0ad9eb.zip
git-fa82be982dfc5b463a125991a2d381f1cd0ad9eb.tar.gz
git-fa82be982dfc5b463a125991a2d381f1cd0ad9eb.tar.bz2
Merge branch 'hi/gpg-prefer-check-signature'
The code to interface with GnuPG has been refactored. * hi/gpg-prefer-check-signature: gpg-interface: prefer check_signature() for GPG verification t: increase test coverage of signature verification output
Diffstat (limited to 'builtin')
-rw-r--r--builtin/fmt-merge-msg.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c
index 736f666..172dfbd 100644
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
@@ -494,6 +494,7 @@ static void fmt_merge_msg_sigs(struct strbuf *out)
enum object_type type;
unsigned long size, len;
char *buf = read_object_file(oid, &type, &size);
+ struct signature_check sigc = { 0 };
struct strbuf sig = STRBUF_INIT;
if (!buf || type != OBJ_TAG)
@@ -502,10 +503,12 @@ static void fmt_merge_msg_sigs(struct strbuf *out)
if (size == len)
; /* merely annotated */
- else if (verify_signed_buffer(buf, len, buf + len, size - len, &sig, NULL)) {
- if (!sig.len)
- strbuf_addstr(&sig, "gpg verification failed.\n");
- }
+ else if (check_signature(buf, len, buf + len, size - len, &sigc) &&
+ !sigc.gpg_output)
+ strbuf_addstr(&sig, "gpg verification failed.\n");
+ else
+ strbuf_addstr(&sig, sigc.gpg_output);
+ signature_check_clear(&sigc);
if (!tag_number++) {
fmt_tag_signature(&tagbuf, &sig, buf, len);