xref: /freebsd/crypto/openssh/regress/keygen-change.sh (revision 19261079b74319502c6ffa1249920079f0f69a72)
1#	$OpenBSD: keygen-change.sh,v 1.9 2019/12/16 02:39:05 djm Exp $
2#	Placed in the Public Domain.
3
4tid="change passphrase for key"
5
6S1="secret1"
7S2="2secret"
8
9for t in $SSH_KEYTYPES; do
10	trace "generating $t key"
11	rm -f $OBJ/$t-key
12	${SSHKEYGEN} -q -N ${S1} -t $t -f $OBJ/$t-key
13	if [ $? -eq 0 ]; then
14		${SSHKEYGEN} -p -P ${S1} -N ${S2} -f $OBJ/$t-key > /dev/null
15		if [ $? -ne 0 ]; then
16			fail "ssh-keygen -p failed for $t-key"
17		fi
18	else
19		fail "ssh-keygen for $t-key failed"
20	fi
21	rm -f $OBJ/$t-key $OBJ/$t-key.pub
22done
23