xref: /freebsd-src/crypto/openssh/regress/misc/fuzz-harness/testdata/create-agent-corpus.sh (revision 19261079b74319502c6ffa1249920079f0f69a72)
1*19261079SEd Maste#!/bin/sh
2*19261079SEd Maste
3*19261079SEd Maste# Exercise ssh-agent to generate fuzzing corpus
4*19261079SEd Maste
5*19261079SEd Maste# XXX assumes agent hacked up with sk-dummy.o and ssh-sk.o linked directly
6*19261079SEd Maste#     and dumping of e->request for each message.
7*19261079SEd Maste
8*19261079SEd Masteset -xe
9*19261079SEd MasteSSH_AUTH_SOCK=$PWD/sock
10*19261079SEd Masterm -f agent-[0-9]* $SSH_AUTH_SOCK
11*19261079SEd Masteexport SSH_AUTH_SOCK
12*19261079SEd Maste../../../../ssh-agent -D -a $SSH_AUTH_SOCK &
13*19261079SEd Mastesleep 1
14*19261079SEd MasteAGENT_PID=$!
15*19261079SEd Mastetrap "kill $AGENT_PID" EXIT
16*19261079SEd Maste
17*19261079SEd MastePRIV="id_dsa id_ecdsa id_ecdsa_sk id_ed25519 id_ed25519_sk id_rsa"
18*19261079SEd Maste
19*19261079SEd Maste# add keys
20*19261079SEd Mastessh-add $PRIV
21*19261079SEd Maste
22*19261079SEd Maste# sign
23*19261079SEd Mastessh-add -T *.pub
24*19261079SEd Maste
25*19261079SEd Maste# list
26*19261079SEd Mastessh-add -l
27*19261079SEd Maste
28*19261079SEd Maste# remove individually
29*19261079SEd Mastessh-add -d $PRIV
30*19261079SEd Maste
31*19261079SEd Maste# re-add with constraints
32*19261079SEd Mastessh-add -c -t 3h $PRIV
33*19261079SEd Maste
34*19261079SEd Maste# delete all
35*19261079SEd Mastessh-add -D
36*19261079SEd Maste
37*19261079SEd Maste# attempt to add a PKCS#11 token
38*19261079SEd Mastessh-add -s /fake || :
39*19261079SEd Maste
40*19261079SEd Maste# attempt to delete PKCS#11
41*19261079SEd Mastessh-add -e /fake || :
42*19261079SEd Maste
43*19261079SEd Mastessh-add -L
44*19261079SEd Maste
45