djm@openbsd.org | dd36932 | 2017-04-30 23:34:55 +0000 | [diff] [blame] | 1 | # $OpenBSD: try-ciphers.sh,v 1.26 2017/04/30 23:34:55 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 |
djm@openbsd.org | dd36932 | 2017-04-30 23:34:55 +0000 | [diff] [blame] | 11 | trace "cipher $c mac $m" |
| 12 | verbose "test $tid: 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 |
djm@openbsd.org | dd36932 | 2017-04-30 23:34:55 +0000 | [diff] [blame] | 16 | ${SSH} -F $OBJ/ssh_proxy -m $m -c $c somehost true |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 17 | if [ $? -ne 0 ]; then |
djm@openbsd.org | dd36932 | 2017-04-30 23:34:55 +0000 | [diff] [blame] | 18 | fail "ssh failed with mac $m cipher $c" |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 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. |
markus@openbsd.org | 9e1777a | 2015-03-24 20:19:15 +0000 | [diff] [blame] | 22 | if ${SSH} -Q cipher-auth | grep "^${c}\$" >/dev/null 2>&1 ; then |
Damien Miller | 8a073cf | 2013-11-21 14:26:18 +1100 | [diff] [blame] | 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 | |