1# $OpenBSD: keygen-change.sh,v 1.6 2017/04/30 23:34:55 djm Exp $ 2# Placed in the Public Domain. 3 4tid="change passphrase for key" 5 6S1="secret1" 7S2="2secret" 8 9KEYTYPES=`${SSH} -Q key-plain` 10 11for t in $KEYTYPES; do 12 # generate user key for agent 13 trace "generating $t key" 14 rm -f $OBJ/$t-key 15 ${SSHKEYGEN} -q -N ${S1} -t $t -f $OBJ/$t-key 16 if [ $? -eq 0 ]; then 17 ${SSHKEYGEN} -p -P ${S1} -N ${S2} -f $OBJ/$t-key > /dev/null 18 if [ $? -ne 0 ]; then 19 fail "ssh-keygen -p failed for $t-key" 20 fi 21 else 22 fail "ssh-keygen for $t-key failed" 23 fi 24 rm -f $OBJ/$t-key $OBJ/$t-key.pub 25done 26