openssh/regress/keygen-change.sh
djm@openbsd.org afa59e26ee upstream: skip security-key key types for tests until we have a
dummy U2F middleware to use.

OpenBSD-Regress-ID: 37200462b44334a4ad45e6a1f7ad1bd717521a95
2019-11-01 13:10:09 +11:00

26 lines
596 B
Bash

# $OpenBSD: keygen-change.sh,v 1.7 2019/11/01 01:55:41 djm Exp $
# Placed in the Public Domain.
tid="change passphrase for key"
S1="secret1"
S2="2secret"
KEYTYPES=`${SSH} -Q key-plain | grep -v ^sk-`
for t in $KEYTYPES; do
# generate user key for agent
trace "generating $t key"
rm -f $OBJ/$t-key
${SSHKEYGEN} -q -N ${S1} -t $t -f $OBJ/$t-key
if [ $? -eq 0 ]; then
${SSHKEYGEN} -p -P ${S1} -N ${S2} -f $OBJ/$t-key > /dev/null
if [ $? -ne 0 ]; then
fail "ssh-keygen -p failed for $t-key"
fi
else
fail "ssh-keygen for $t-key failed"
fi
rm -f $OBJ/$t-key $OBJ/$t-key.pub
done