Damien Miller | edb1af5 | 2014-05-15 15:07:53 +1000 | [diff] [blame^] | 1 | # $OpenBSD: try-ciphers.sh,v 1.23 2014/04/21 22:15:37 djm Exp $ |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 2 | # Placed in the Public Domain. |
| 3 | |
| 4 | tid="try ciphers" |
| 5 | |
Damien Miller | edb1af5 | 2014-05-15 15:07:53 +1000 | [diff] [blame^] | 6 | cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak |
| 7 | |
Darren Tucker | a955041 | 2013-11-07 15:21:19 +1100 | [diff] [blame] | 8 | for c in `${SSH} -Q cipher`; do |
Damien Miller | 846dc7f | 2013-01-12 22:46:26 +1100 | [diff] [blame] | 9 | n=0 |
Darren Tucker | a955041 | 2013-11-07 15:21:19 +1100 | [diff] [blame] | 10 | for m in `${SSH} -Q mac`; do |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 11 | trace "proto 2 cipher $c mac $m" |
| 12 | verbose "test $tid: proto 2 cipher $c mac $m" |
Damien Miller | edb1af5 | 2014-05-15 15:07:53 +1000 | [diff] [blame^] | 13 | cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy |
| 14 | echo "Ciphers=$c" >> $OBJ/sshd_proxy |
| 15 | echo "MACs=$m" >> $OBJ/sshd_proxy |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 16 | ${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 Miller | 8a073cf | 2013-11-21 14:26:18 +1100 | [diff] [blame] | 20 | # 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 Rice | c08b3ef | 2013-02-19 11:53:29 -0800 | [diff] [blame] | 25 | n=`expr $n + 1` |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 26 | done |
| 27 | done |
| 28 | |
| 29 | ciphers="3des blowfish" |
| 30 | for 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 |
| 37 | done |
Darren Tucker | 9468ba3 | 2004-02-29 20:38:26 +1100 | [diff] [blame] | 38 | |