diff options
author | Sebastian Götte <jaseg@physik.tu-berlin.de> | 2013-03-31 18:01:34 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-03-31 19:16:15 -0700 |
commit | f8aae8d0efccd268babd482f10709b4f86a9f32e (patch) | |
tree | e46ec28fae350ae43e84d56d70772bc77fa7f68b /commit.c | |
parent | ffb6d7d5c99e4097e512def20b0133b7ee900953 (diff) | |
download | git-f8aae8d0efccd268babd482f10709b4f86a9f32e.tar.gz |
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>
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -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'); |