Skip to content

Commit

Permalink
commit.c/GPG signature verification: Also look at the first GPG statu…
Browse files Browse the repository at this point in the history
…s line

Signed-off-by: Sebastian Götte <jaseg@physik-pool.tu-berlin.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Sebastian Götte authored and Junio C Hamano committed Apr 1, 2013
1 parent ffb6d7d commit f8aae8d
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1054,13 +1054,20 @@ static void parse_gpg_output(struct signature_check *sigc)
const char *buf = sigc->gpg_status;
int i;

/* Iterate over all search strings */
for (i = 0; i < ARRAY_SIZE(sigcheck_gpg_status); i++) {
const char *found = strstr(buf, sigcheck_gpg_status[i].check);
const char *next;
if (!found)
continue;
const char *found, *next;

if (!prefixcmp(buf, sigcheck_gpg_status[i].check + 1)) {
/* At the very beginning of the buffer */
found = buf + strlen(sigcheck_gpg_status[i].check + 1);
} else {
found = strstr(buf, sigcheck_gpg_status[i].check);
if (!found)
continue;
found += strlen(sigcheck_gpg_status[i].check);
}
sigc->result = sigcheck_gpg_status[i].result;
found += strlen(sigcheck_gpg_status[i].check);
sigc->key = xmemdupz(found, 16);
found += 17;
next = strchrnul(found, '\n');
Expand Down

0 comments on commit f8aae8d

Please sign in to comment.