blob: 2881ce16c13bc9252f7babb30754901fe70f11e9 [file] [log] [blame]
Damien Milleredb1af52014-05-15 15:07:53 +10001# $OpenBSD: try-ciphers.sh,v 1.23 2014/04/21 22:15:37 djm Exp $
Damien Miller38cd4352002-05-01 13:17:33 +10002# Placed in the Public Domain.
3
4tid="try ciphers"
5
Damien Milleredb1af52014-05-15 15:07:53 +10006cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak
7
Darren Tuckera9550412013-11-07 15:21:19 +11008for c in `${SSH} -Q cipher`; do
Damien Miller846dc7f2013-01-12 22:46:26 +11009 n=0
Darren Tuckera9550412013-11-07 15:21:19 +110010 for m in `${SSH} -Q mac`; do
Damien Miller38cd4352002-05-01 13:17:33 +100011 trace "proto 2 cipher $c mac $m"
12 verbose "test $tid: proto 2 cipher $c mac $m"
Damien Milleredb1af52014-05-15 15:07:53 +100013 cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy
14 echo "Ciphers=$c" >> $OBJ/sshd_proxy
15 echo "MACs=$m" >> $OBJ/sshd_proxy
Damien Miller38cd4352002-05-01 13:17:33 +100016 ${SSH} -F $OBJ/ssh_proxy -2 -m $m -c $c somehost true
17 if [ $? -ne 0 ]; then
18 fail "ssh -2 failed with mac $m cipher $c"
19 fi
Damien Miller8a073cf2013-11-21 14:26:18 +110020 # No point trying all MACs for AEAD ciphers since they
21 # are ignored.
22 if ssh -Q cipher-auth | grep "^${c}\$" >/dev/null 2>&1 ; then
23 break
24 fi
Tim Ricec08b3ef2013-02-19 11:53:29 -080025 n=`expr $n + 1`
Damien Miller38cd4352002-05-01 13:17:33 +100026 done
27done
28
29ciphers="3des blowfish"
30for c in $ciphers; do
31 trace "proto 1 cipher $c"
32 verbose "test $tid: proto 1 cipher $c"
33 ${SSH} -F $OBJ/ssh_proxy -1 -c $c somehost true
34 if [ $? -ne 0 ]; then
35 fail "ssh -1 failed with cipher $c"
36 fi
37done
Darren Tucker9468ba32004-02-29 20:38:26 +110038