diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 14:40:04 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 14:40:04 +0000 |
commit | 25505898530a333011f4fd5cbc841ad6b26c089c (patch) | |
tree | 333a33fdd60930bcccc3f177ed9467d535e9bac6 /regress/misc/fuzz-harness/testdata/create-agent-corpus.sh | |
parent | Initial commit. (diff) | |
download | openssh-upstream.tar.xz openssh-upstream.zip |
Adding upstream version 1:9.2p1.upstream/1%9.2p1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'regress/misc/fuzz-harness/testdata/create-agent-corpus.sh')
-rwxr-xr-x | regress/misc/fuzz-harness/testdata/create-agent-corpus.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/regress/misc/fuzz-harness/testdata/create-agent-corpus.sh b/regress/misc/fuzz-harness/testdata/create-agent-corpus.sh new file mode 100755 index 0000000..1043b9f --- /dev/null +++ b/regress/misc/fuzz-harness/testdata/create-agent-corpus.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +# Exercise ssh-agent to generate fuzzing corpus + +# XXX assumes agent hacked up with sk-dummy.o and ssh-sk.o linked directly +# and dumping of e->request for each message. + +set -xe +SSH_AUTH_SOCK=$PWD/sock +rm -f agent-[0-9]* $SSH_AUTH_SOCK +export SSH_AUTH_SOCK +../../../../ssh-agent -D -a $SSH_AUTH_SOCK & +sleep 1 +AGENT_PID=$! +trap "kill $AGENT_PID" EXIT + +PRIV="id_dsa id_ecdsa id_ecdsa_sk id_ed25519 id_ed25519_sk id_rsa" + +# add keys +ssh-add $PRIV + +# sign +ssh-add -T *.pub + +# list +ssh-add -l + +# remove individually +ssh-add -d $PRIV + +# re-add with constraints +ssh-add -c -t 3h $PRIV + +# delete all +ssh-add -D + +# attempt to add a PKCS#11 token +ssh-add -s /fake || : + +# attempt to delete PKCS#11 +ssh-add -e /fake || : + +ssh-add -L + |