From 434060ec6d9bf50f095db901da3fb9b557e11df1 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Sun, 21 Jun 2015 23:14:40 +0000 Subject: gpg: centralize signature check verify-commit and verify-tag both share a central codepath for verifying commits: check_signature. However, verify-tag exited successfully for untrusted signature, while verify-commit exited unsuccessfully. Centralize this signature check and make verify-commit adopt the older verify-tag behavior. This behavior is more logical anyway, as the signature is in fact valid, whether or not there's a path of trust to the author. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- builtin/verify-tag.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'builtin/verify-tag.c') diff --git a/builtin/verify-tag.c b/builtin/verify-tag.c index e1eb341bae..8750bef016 100644 --- a/builtin/verify-tag.c +++ b/builtin/verify-tag.c @@ -22,6 +22,7 @@ static int run_gpg_verify(const char *buf, unsigned long size, int verbose) { struct signature_check sigc; int len; + int ret; memset(&sigc, 0, sizeof(sigc)); @@ -32,11 +33,11 @@ static int run_gpg_verify(const char *buf, unsigned long size, int verbose) if (size == len) return error("no signature found"); - check_signature(buf, len, buf + len, size - len, &sigc); + ret = check_signature(buf, len, buf + len, size - len, &sigc); fputs(sigc.gpg_output, stderr); signature_check_clear(&sigc); - return sigc.result != 'G' && sigc.result != 'U'; + return ret; } static int verify_tag(const char *name, int verbose) -- cgit v1.2.3