git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 3/7] verify-commit: add test for exit status on untrusted signature

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jun 21, 2015, 23:14 UTC
Message-ID
<1434928483-105916-4-git-send-email-sandals@crustytoothpaste.net>
In-Reply-To
<1434928483-105916-1-git-send-email-sandals@crustytoothpaste.net>

verify-tag exits successfully if the signature is good but the key is untrusted. verify-commit exits unsuccessfully. This divergence in behavior is unexpected and unwanted. Since verify-tag existed earlier, add a failing test to have verify-commit share verify-tag's behavior.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
---
 t/t7510-signed-commit.sh | 7 +++++++
 1 file changed, 7 insertions(+)
diff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh
index 13331e5..4fc376e 100755
--- a/t/t7510-signed-commit.sh
+++ b/t/t7510-signed-commit.sh
@@ -81,6 +81,13 @@ test_expect_success GPG 'verify and show signatures' '
 	)
 '
 
+test_expect_failure GPG 'verify-commit exits success on untrusted signature' '
+	git verify-commit eighth-signed-alt 2>actual &&
+	grep "Good signature from" actual &&
+	! grep "BAD signature from" actual &&
+	grep "not certified" actual
+'
+
 test_expect_success GPG 'show signed commit with signature' '
 	git show -s initial >commit &&
 	git show -s --show-signature initial >show &&
-- 
2.4.0
Previous: brian m. carlsonNext: brian m. carlson
Message 4 of 9 in “Raw gpg output support for verify-commit and verify-tag”
  1. 0/7 Raw gpg output support for verify-commit and verify-tagbrian m. carlson, Jun 21, 2015
  2. 1/7 verify-tag: add testsbrian m. carlson, Jun 21, 2015
  3. 2/7 verify-tag: share code with verify-commitbrian m. carlson, Jun 21, 2015
  4. 3/7 verify-commit: add test for exit status on untrusted signaturebrian m. carlson, Jun 21, 2015
  5. 4/7 gpg: centralize signature checkbrian m. carlson, Jun 21, 2015
  6. 5/7 gpg: centralize printing signature buffersbrian m. carlson, Jun 21, 2015
  7. 6/7 verify-commit: add option to print raw gpg status informationbrian m. carlson, Jun 21, 2015
  8. 7/7 verify-tag: add option to print raw gpg status informationbrian m. carlson, Jun 21, 2015
  9. Junio C HamanoJun 22, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.