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

[PATCH] t/lib-gpg: fix ssh-keygen -Y check-novalidate with openssh-9.0

From
Todd Zullinger <tmz@pobox.com>
Date
May 25, 2023, 03:10 UTC
Message-ID
<20230525031026.3554406-1-tmz@pobox.com>

OpenSSH-9.0 requires a namespace option with `-Y check-novalidate`. This was added in openssh-portable commit a0b5816f8 (upstream: ssh-keygen -Y check-novalidate requires namespace or SEGV, 2022-03-18).

The -n option was documented as a required option since check-novalidate was added in openssh-portable 8aa2aa3cd (upstream: Allow testing signature syntax and validity without verifying, 2019-09-16).

Signed-off-by: Todd Zullinger <tmz@pobox.com>
---
Hi,

I only recently noticed the GPGSSH_VERIFYTIME prereq had been failing in the Fedora builds. This began when openssh was updated to 9.0 in the distribution, which means I've been slack on checking missing prereqs since last August. :/

Initially, I thought it was another issue, where the final ssh-keygen call in the prereq lacked a message on stdin, which caused it to hang.

That only occurs when running the contents of the prereq manually, so it may not be worth touching. But if that seems worthwhile -- if only to avoid anyone else getting spending time debugging the wrong problem -- I can send the patch I had prepared which does:

  diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh
  index 114785586a..2815df8503 100644
  --- a/t/lib-gpg.sh
  +++ b/t/lib-gpg.sh
  @@ -165,7 +165,7 @@ test_lazy_prereq GPGSSH_VERIFYTIME '
   	# and verify ssh-keygen verifies the key lifetime
   	echo "testpayload" |
   	ssh-keygen -Y sign -n "git" -f "${GPGSSH_KEY_EXPIRED}" >gpgssh_verifytime_prereq.sig &&
  -	! (ssh-keygen -Y verify -n "git" -f "${GPGSSH_ALLOWED_SIGNERS}" -I "principal with expired key" -s gpgssh_verifytime_prereq.sig)
  +	! (echo "testpayload" | ssh-keygen -Y verify -n "git" -f "${GPGSSH_ALLOWED_SIGNERS}" -I "principal with expired key" -s gpgssh_verifytime_prereq.sig)
   '
   
   sanitize_pgp() {
 t/lib-gpg.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh
index 114785586a..28652ed91f 100644
--- a/t/lib-gpg.sh
+++ b/t/lib-gpg.sh
@@ -136,7 +136,7 @@ test_lazy_prereq GPGSSH '
 
 test_lazy_prereq GPGSSH_VERIFYTIME '
 	# Check if ssh-keygen has a verify-time option by passing an invalid date to it
-	ssh-keygen -Overify-time=INVALID -Y check-novalidate -s doesnotmatter 2>&1 | grep -q -F "Invalid \"verify-time\"" &&
+	ssh-keygen -Overify-time=INVALID -Y check-novalidate -n "git" -s doesnotmatter 2>&1 | grep -q -F "Invalid \"verify-time\"" &&
 
 	# Set up keys with key lifetimes
 	ssh-keygen -t ed25519 -N "" -C "timeboxed valid key" -f "${GPGSSH_KEY_TIMEBOXEDVALID}" >/dev/null &&
-- 
2.41.0.rc2
Next: Junio C Hamano
Message 1 of 5 in “t/lib-gpg: fix ssh-keygen -Y check-novalidate with openssh-9.0”
  1. t/lib-gpg: fix ssh-keygen -Y check-novalidate with openssh-9.0Todd Zullinger, May 25, 2023
  2. Junio C HamanoMay 26, 2023
  3. Todd ZullingerMay 26, 2023
  4. Junio C HamanoJun 1, 2023
  5. t/lib-gpg: require GPGSSH for GPGSSH_VERIFYTIME prereqTodd Zullinger, Jun 6, 2023

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.