try-ciphers.sh revision 262566
1#	$OpenBSD: try-ciphers.sh,v 1.22 2013/11/21 03:18:51 djm Exp $
2#	Placed in the Public Domain.
3
4tid="try ciphers"
5
6for c in `${SSH} -Q cipher`; do
7	n=0
8	for m in `${SSH} -Q mac`; do
9		trace "proto 2 cipher $c mac $m"
10		verbose "test $tid: proto 2 cipher $c mac $m"
11		${SSH} -F $OBJ/ssh_proxy -2 -m $m -c $c somehost true
12		if [ $? -ne 0 ]; then
13			fail "ssh -2 failed with mac $m cipher $c"
14		fi
15		# No point trying all MACs for AEAD ciphers since they
16		# are ignored.
17		if ssh -Q cipher-auth | grep "^${c}\$" >/dev/null 2>&1 ; then
18			break
19		fi
20		n=`expr $n + 1`
21	done
22done
23
24ciphers="3des blowfish"
25for c in $ciphers; do
26	trace "proto 1 cipher $c"
27	verbose "test $tid: proto 1 cipher $c"
28	${SSH} -F $OBJ/ssh_proxy -1 -c $c somehost true
29	if [ $? -ne 0 ]; then
30		fail "ssh -1 failed with cipher $c"
31	fi
32done
33
34