Damien Miller | 8a073cf | 2013-11-21 14:26:18 +1100 | [diff] [blame] | 1 | # $OpenBSD: try-ciphers.sh,v 1.22 2013/11/21 03:18:51 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 | |
Darren Tucker | a955041 | 2013-11-07 15:21:19 +1100 | [diff] [blame] | 6 | for c in `${SSH} -Q cipher`; do |
Damien Miller | 846dc7f | 2013-01-12 22:46:26 +1100 | [diff] [blame] | 7 | n=0 |
Darren Tucker | a955041 | 2013-11-07 15:21:19 +1100 | [diff] [blame] | 8 | for m in `${SSH} -Q mac`; do |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 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 |
Damien Miller | 8a073cf | 2013-11-21 14:26:18 +1100 | [diff] [blame] | 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 |
Tim Rice | c08b3ef | 2013-02-19 11:53:29 -0800 | [diff] [blame] | 20 | n=`expr $n + 1` |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 21 | done |
| 22 | done |
| 23 | |
| 24 | ciphers="3des blowfish" |
| 25 | for 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 |
| 32 | done |
Darren Tucker | 9468ba3 | 2004-02-29 20:38:26 +1100 | [diff] [blame] | 33 | |