1224145Sdim#	$OpenBSD: conch-ciphers.sh,v 1.3 2013/05/17 04:29:14 dtucker Exp $
2224145Sdim#	Placed in the Public Domain.
3246259Sdim
4246259Sdimtid="conch ciphers"
5224145Sdim
6224145Sdimif test "x$REGRESS_INTEROP_CONCH" != "xyes" ; then
7224145Sdim	echo "conch interop tests not enabled"
8224145Sdim	exit 0
9224145Sdimfi
10224145Sdim
11234353Sdimstart_sshd
12226633Sdim
13226633Sdimfor c in aes256-ctr aes256-cbc aes192-ctr aes192-cbc aes128-ctr aes128-cbc \
14224145Sdim         cast128-cbc blowfish 3des-cbc ; do
15224145Sdim	verbose "$tid: cipher $c"
16224145Sdim	rm -f ${COPY}
17224145Sdim	# XXX the 2nd "cat" seems to be needed because of buggy FD handling
18234353Sdim	# in conch
19234353Sdim	${CONCH} --identity $OBJ/rsa --port $PORT --user $USER  -e none \
20224145Sdim	    --known-hosts $OBJ/known_hosts --notty --noagent --nox11 -n \
21249423Sdim	    127.0.0.1 "cat ${DATA}" 2>/dev/null | cat > ${COPY}
22224145Sdim	if [ $? -ne 0 ]; then
23224145Sdim		fail "ssh cat $DATA failed"
24224145Sdim	fi
25249423Sdim	cmp ${DATA} ${COPY}		|| fail "corrupted copy"
26249423Sdimdone
27249423Sdimrm -f ${COPY}
28224145Sdim
29224145Sdim