mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
commit.c/GPG signature verification: Also look at the first GPG status line
Signed-off-by: Sebastian Götte <jaseg@physik-pool.tu-berlin.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
ffb6d7d5c9
commit
f8aae8d0ef
17
commit.c
17
commit.c
|
@ -1054,13 +1054,20 @@ static void parse_gpg_output(struct signature_check *sigc)
|
||||||
const char *buf = sigc->gpg_status;
|
const char *buf = sigc->gpg_status;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
/* Iterate over all search strings */
|
||||||
for (i = 0; i < ARRAY_SIZE(sigcheck_gpg_status); i++) {
|
for (i = 0; i < ARRAY_SIZE(sigcheck_gpg_status); i++) {
|
||||||
const char *found = strstr(buf, sigcheck_gpg_status[i].check);
|
const char *found, *next;
|
||||||
const char *next;
|
|
||||||
if (!found)
|
if (!prefixcmp(buf, sigcheck_gpg_status[i].check + 1)) {
|
||||||
continue;
|
/* 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;
|
sigc->result = sigcheck_gpg_status[i].result;
|
||||||
found += strlen(sigcheck_gpg_status[i].check);
|
|
||||||
sigc->key = xmemdupz(found, 16);
|
sigc->key = xmemdupz(found, 16);
|
||||||
found += 17;
|
found += 17;
|
||||||
next = strchrnul(found, '\n');
|
next = strchrnul(found, '\n');
|
||||||
|
|
Loading…
Reference in a new issue