summaryrefslogtreecommitdiff
path: root/log-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-03-21 14:02:55 -0700
committerJunio C Hamano <gitster@pobox.com>2013-03-21 14:02:55 -0700
commit0f6875dbe2598fd2e9a597a9e42cde4a507140dd (patch)
tree9934b604245af8bb26f1c9b2c8198a6c46a34284 /log-tree.c
parentdcf0d12aed0d4627dcbfdbc52cea75ce74103e46 (diff)
parent0174eeaa736226a0bea19e9bf88c270d61aa9cce (diff)
downloadgit-0f6875dbe2598fd2e9a597a9e42cde4a507140dd.tar.gz
Merge branch 'mg/gpg-interface-using-status'
Call "gpg" using the right API when validating the signature on tags. * mg/gpg-interface-using-status: pretty: make %GK output the signing key for signed commits pretty: parse the gpg status lines rather than the output gpg_interface: allow to request status return log-tree: rely upon the check in the gpg_interface gpg-interface: check good signature in a reliable way
Diffstat (limited to 'log-tree.c')
-rw-r--r--log-tree.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/log-tree.c b/log-tree.c
index 5dc45c4812..3d88823871 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -444,7 +444,7 @@ static void show_signature(struct rev_info *opt, struct commit *commit)
status = verify_signed_buffer(payload.buf, payload.len,
signature.buf, signature.len,
- &gpg_output);
+ &gpg_output, NULL);
if (status && !gpg_output.len)
strbuf_addstr(&gpg_output, "No signature\n");
@@ -508,20 +508,17 @@ static void show_one_mergetag(struct rev_info *opt,
gpg_message_offset = verify_message.len;
payload_size = parse_signature(extra->value, extra->len);
- if ((extra->len <= payload_size) ||
- (verify_signed_buffer(extra->value, payload_size,
- extra->value + payload_size,
- extra->len - payload_size,
- &verify_message) &&
- verify_message.len <= gpg_message_offset)) {
- strbuf_addstr(&verify_message, "No signature\n");
- status = -1;
- }
- else if (strstr(verify_message.buf + gpg_message_offset,
- ": Good signature from "))
- status = 0;
- else
- status = -1;
+ status = -1;
+ if (extra->len > payload_size)
+ if (verify_signed_buffer(extra->value, payload_size,
+ extra->value + payload_size,
+ extra->len - payload_size,
+ &verify_message, NULL)) {
+ if (verify_message.len <= gpg_message_offset)
+ strbuf_addstr(&verify_message, "No signature\n");
+ else
+ status = 0;
+ }
show_sig_lines(opt, status, verify_message.buf);
strbuf_release(&verify_message);