Lines Matching +full:- +full:- +full:exit +full:- +full:code
1 # $OpenBSD: agent-pkcs11.sh,v 1.2 2015/01/12 11:46:32 djm Exp $
7 TEST_SSH_PKCS11=/usr/local/lib/soft-pkcs11.so.0.0
9 test -f "$TEST_SSH_PKCS11" || fatal "$TEST_SSH_PKCS11 does not exist"
11 # setup environment for soft-pkcs11 token
14 # prevent ssh-agent from calling ssh-askpass
19 # start command w/o tty, so ssh-add accepts pin from stdin
21 perl -e 'use POSIX; POSIX::setsid();
22 if (fork) { wait; exit($? >> 8); } else { exec(@ARGV) }' "$@"
26 eval `${SSHAGENT} -s` > /dev/null
28 if [ $r -ne 0 ]; then
29 fail "could not start ssh-agent: exit code $r"
32 rm -f $OBJ/pkcs11.key $OBJ/pkcs11.crt
33 openssl genrsa -out $OBJ/pkcs11.key 2048 > /dev/null 2>&1
35 openssl req -key $OBJ/pkcs11.key -new -x509 \
36 -out $OBJ/pkcs11.crt -text -subj '/CN=pkcs11 test' > /dev/null
39 ${SSHKEYGEN} -y -f $OBJ/pkcs11.key > $OBJ/authorized_keys_$USER
42 echo ${TEST_SSH_PIN} | notty ${SSHADD} -s ${TEST_SSH_PKCS11} > /dev/null 2>&1
44 if [ $r -ne 0 ]; then
45 fail "ssh-add -s failed: exit code $r"
49 ${SSHADD} -l > /dev/null 2>&1
51 if [ $r -ne 0 ]; then
52 fail "ssh-add -l failed: exit code $r"
56 ${SSH} -2 -F $OBJ/ssh_proxy somehost exit 5
58 if [ $r -ne 5 ]; then
59 fail "ssh connect failed (exit code $r)"
63 echo ${TEST_SSH_PIN} | notty ${SSHADD} -e ${TEST_SSH_PKCS11} > /dev/null 2>&1
65 if [ $r -ne 0 ]; then
66 fail "ssh-add -e failed: exit code $r"
70 ${SSHAGENT} -k > /dev/null