create-agent-corpus.sh 748 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/usr/bin/env sh
  2. # Exercise ssh-agent to generate fuzzing corpus
  3. # XXX assumes agent hacked up with sk-dummy.o and ssh-sk.o linked directly
  4. # and dumping of e->request for each message.
  5. set -xe
  6. SSH_AUTH_SOCK=$PWD/sock
  7. rm -f agent-[0-9]* $SSH_AUTH_SOCK
  8. export SSH_AUTH_SOCK
  9. ../../../../ssh-agent -D -a $SSH_AUTH_SOCK &
  10. sleep 1
  11. AGENT_PID=$!
  12. trap "kill $AGENT_PID" EXIT
  13. PRIV="id_dsa id_ecdsa id_ecdsa_sk id_ed25519 id_ed25519_sk id_rsa"
  14. # add keys
  15. ssh-add $PRIV
  16. # sign
  17. ssh-add -T *.pub
  18. # list
  19. ssh-add -l
  20. # remove individually
  21. ssh-add -d $PRIV
  22. # re-add with constraints
  23. ssh-add -c -t 3h $PRIV
  24. # delete all
  25. ssh-add -D
  26. # attempt to add a PKCS#11 token
  27. ssh-add -s /fake || :
  28. # attempt to delete PKCS#11
  29. ssh-add -e /fake || :
  30. ssh-add -L