xref: /freebsd/crypto/openssh/regress/conch-ciphers.sh (revision 069ac18495ad8fde2748bc94b0f80a50250bb01d)
1*069ac184SEd Maste#	$OpenBSD: conch-ciphers.sh,v 1.7 2023/10/26 12:44:07 dtucker Exp $
2ce3adf43SDag-Erling Smørgrav#	Placed in the Public Domain.
3ce3adf43SDag-Erling Smørgrav
4ce3adf43SDag-Erling Smørgravtid="conch ciphers"
5ce3adf43SDag-Erling Smørgrav
6ce3adf43SDag-Erling Smørgravif test "x$REGRESS_INTEROP_CONCH" != "xyes" ; then
7*069ac184SEd Maste	skip "conch interop tests not enabled"
8*069ac184SEd Mastefi
9*069ac184SEd Maste
10*069ac184SEd Masteif ! [ -t 0 ]; then
11*069ac184SEd Maste	skip "conch interop tests requires a controlling terminal"
12ce3adf43SDag-Erling Smørgravfi
13ce3adf43SDag-Erling Smørgrav
14ce3adf43SDag-Erling Smørgravstart_sshd
15ce3adf43SDag-Erling Smørgrav
16ce3adf43SDag-Erling Smørgravfor c in aes256-ctr aes256-cbc aes192-ctr aes192-cbc aes128-ctr aes128-cbc \
17ce3adf43SDag-Erling Smørgrav         cast128-cbc blowfish 3des-cbc ; do
18ce3adf43SDag-Erling Smørgrav	verbose "$tid: cipher $c"
19ce3adf43SDag-Erling Smørgrav	rm -f ${COPY}
20ce3adf43SDag-Erling Smørgrav	# XXX the 2nd "cat" seems to be needed because of buggy FD handling
21ce3adf43SDag-Erling Smørgrav	# in conch
22*069ac184SEd Maste	${CONCH} --identity $OBJ/ssh-ed25519 --port $PORT --user $USER -e none \
23ce3adf43SDag-Erling Smørgrav	    --known-hosts $OBJ/known_hosts --notty --noagent --nox11 -n \
24ce3adf43SDag-Erling Smørgrav	    127.0.0.1 "cat ${DATA}" 2>/dev/null | cat > ${COPY}
25ce3adf43SDag-Erling Smørgrav	if [ $? -ne 0 ]; then
26ce3adf43SDag-Erling Smørgrav		fail "ssh cat $DATA failed"
27ce3adf43SDag-Erling Smørgrav	fi
28ce3adf43SDag-Erling Smørgrav	cmp ${DATA} ${COPY}		|| fail "corrupted copy"
29ce3adf43SDag-Erling Smørgravdone
30ce3adf43SDag-Erling Smørgravrm -f ${COPY}
31ce3adf43SDag-Erling Smørgrav
32