All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: git@vger.kernel.org
Cc: Mariusz Gronczewski <xani666@gmail.com>
Subject: [PATCH 2/5] log-tree: rely upon the check in the gpg_interface
Date: Thu, 14 Feb 2013 17:04:43 +0100	[thread overview]
Message-ID: <a266fc66b482fa63dd2dd4db4862a073a0c83296.1360857415.git.git@drmicha.warpmail.net> (raw)
In-Reply-To: <CAJ9Ak2pLqUesOWKNtjwG7P_BW7-EqJP4Kaj0FF_+72Wn=oGoew@mail.gmail.com>
In-Reply-To: <cover.1360857415.git.git@drmicha.warpmail.net>

It's just so much betterer.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
 log-tree.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/log-tree.c b/log-tree.c
index 5dc45c4..912fe08 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -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)) {
+			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);
-- 
1.8.1.3.797.ge0260c7

  parent reply	other threads:[~2013-02-14 16:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-14  0:18 [BUG] Veryfing signatures in git log fails when language is not english XANi
2013-02-14 10:55 ` Michael J Gruber
2013-02-14 12:42   ` Mariusz Gronczewski
2013-02-14 16:04     ` [PATCH 0/5] gpg_interface: use the status Michael J Gruber
2013-02-14 16:04       ` [PATCH 1/5] gpg-interface: check good signature in a reliable way Michael J Gruber
2013-02-14 17:22         ` Junio C Hamano
2013-02-15  8:27           ` Michael J Gruber
2013-02-14 16:04       ` Michael J Gruber [this message]
2013-02-14 16:04       ` [PATCH 3/5] gpg_interface: allow to request status return Michael J Gruber
2013-02-14 16:04       ` [PATCH 4/5] pretty: parse the gpg status lines rather than the output Michael J Gruber
2013-02-14 16:04       ` [PATCH 5/5] pretty: make %GK output the signing key for signed commits Michael J Gruber
2013-02-14 16:47     ` [BUG] Veryfing signatures in git log fails when language is not english Junio C Hamano
2013-02-15 14:14       ` Mariusz Gronczewski
2013-02-15 16:08         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a266fc66b482fa63dd2dd4db4862a073a0c83296.1360857415.git.git@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=xani666@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.