From: Sebastian Götte Date: Tue, 26 Mar 2013 11:05:42 GMT Subject: [PATCH v4 2/5] commit.c/GPG signature verification: Also look at the first GPG status line Message-ID: <51518106.6060804@physik.tu-berlin.de> In-Reply-To: Signed-off-by: Sebastian Götte --- commit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/commit.c b/commit.c index 1aeb17a..533727c 100644 --- a/commit.c +++ b/commit.c @@ -1027,8 +1027,8 @@ static struct { char result; const char *check; } signature_check[] = { - { 'G', "\n[GNUPG:] GOODSIG " }, - { 'B', "\n[GNUPG:] BADSIG " }, + { 'G', "[GNUPG:] GOODSIG " }, + { 'B', "[GNUPG:] BADSIG " }, }; static void parse_signature_lines(struct signature *sig) @@ -1041,6 +1041,9 @@ static void parse_signature_lines(struct signature *sig) const char *next; if (!found) continue; + if (found != buf) + if (found[-1] != '\n') + continue; sig->check_result = signature_check[i].result; found += strlen(signature_check[i].check); sig->key = xmemdupz(found, 16); -- 1.8.1.5