[openssh-commits] [openssh] 03/03: upstream: test SIGUSR1 dropping all keys from ssh-agent

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Oct 24 14:30:19 AEDT 2024


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit de644b1831b970f6655f871c051774cc871e8e74
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Thu Oct 24 03:28:34 2024 +0000

    upstream: test SIGUSR1 dropping all keys from ssh-agent
    
    OpenBSD-Regress-ID: 8654b9aa8eb695b1499fffc408c25319592bf0e0
---
 regress/agent.sh | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/regress/agent.sh b/regress/agent.sh
index 5f106060..f0022aca 100644
--- a/regress/agent.sh
+++ b/regress/agent.sh
@@ -1,4 +1,4 @@
-#	$OpenBSD: agent.sh,v 1.21 2023/03/01 09:29:32 dtucker Exp $
+#	$OpenBSD: agent.sh,v 1.22 2024/10/24 03:28:34 djm Exp $
 #	Placed in the Public Domain.
 
 tid="simple agent test"
@@ -157,7 +157,7 @@ done
 
 ## Deletion tests.
 
-trace "delete all agent keys"
+trace "delete all agent keys using -D"
 ${SSHADD} -D > /dev/null 2>&1
 r=$?
 if [ $r -ne 0 ]; then
@@ -181,6 +181,29 @@ r=$?
 if [ $r -ne 0 ]; then
 	fail "ssh-add -l failed: exit code $r"
 fi
+trace "delete all agent keys using SIGUSR1"
+kill -s USR1 $SSH_AGENT_PID
+r=$?
+if [ $r -ne 0 ]; then
+	fail "kill -s USR1 failed: exit code $r"
+fi
+# make sure they're gone
+${SSHADD} -l > /dev/null 2>&1
+r=$?
+if [ $r -ne 1 ]; then
+	fail "ssh-add -l returned unexpected exit code: $r"
+fi
+# re-add keys/certs to agent
+for t in ${SSH_KEYTYPES}; do
+	${SSHADD} $OBJ/$t-agent-private >/dev/null 2>&1 || \
+		fail "ssh-add failed exit code $?"
+done
+# make sure they are there
+${SSHADD} -l > /dev/null 2>&1
+r=$?
+if [ $r -ne 0 ]; then
+	fail "ssh-add -l failed: exit code $r"
+fi
 
 check_key_absent() {
 	${SSHADD} -L | grep "^$1 " >/dev/null

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list