blob: ac34cedbf910f4d30b442387ad73b834c6624644 [file] [log] [blame]
Damien Miller8a073cf2013-11-21 14:26:18 +11001# $OpenBSD: try-ciphers.sh,v 1.22 2013/11/21 03:18:51 djm Exp $
Damien Miller38cd4352002-05-01 13:17:33 +10002# Placed in the Public Domain.
3
4tid="try ciphers"
5
Darren Tuckera9550412013-11-07 15:21:19 +11006for c in `${SSH} -Q cipher`; do
Damien Miller846dc7f2013-01-12 22:46:26 +11007 n=0
Darren Tuckera9550412013-11-07 15:21:19 +11008 for m in `${SSH} -Q mac`; do
Damien Miller38cd4352002-05-01 13:17:33 +10009 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
Damien Miller8a073cf2013-11-21 14:26:18 +110015 # 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
Tim Ricec08b3ef2013-02-19 11:53:29 -080020 n=`expr $n + 1`
Damien Miller38cd4352002-05-01 13:17:33 +100021 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
Darren Tucker9468ba32004-02-29 20:38:26 +110033