Home | History | Annotate | Download | only in regress
      1 #	$OpenBSD: try-ciphers.sh,v 1.12 2011/08/02 01:23:41 djm Exp $
      2 #	Placed in the Public Domain.
      3 
      4 tid="try ciphers"
      5 
      6 ciphers="aes128-cbc 3des-cbc blowfish-cbc cast128-cbc 
      7 	arcfour128 arcfour256 arcfour 
      8 	aes192-cbc aes256-cbc rijndael-cbc (at] lysator.liu.se
      9 	aes128-ctr aes192-ctr aes256-ctr"
     10 macs="hmac-sha1 hmac-md5 umac-64 (at] openssh.com hmac-sha1-96 hmac-md5-96"
     11 config_defined HAVE_EVP_SHA256 &&
     12     macs="$macs hmac-sha2-256 hmac-sha2-256-96 hmac-sha2-512 hmac-sha2-512-96"
     13 
     14 for c in $ciphers; do
     15 	for m in $macs; do
     16 		trace "proto 2 cipher $c mac $m"
     17 		verbose "test $tid: proto 2 cipher $c mac $m"
     18 		${SSH} -F $OBJ/ssh_proxy -2 -m $m -c $c somehost true
     19 		if [ $? -ne 0 ]; then
     20 			fail "ssh -2 failed with mac $m cipher $c"
     21 		fi
     22 	done
     23 done
     24 
     25 ciphers="3des blowfish"
     26 for c in $ciphers; do
     27 	trace "proto 1 cipher $c"
     28 	verbose "test $tid: proto 1 cipher $c"
     29 	${SSH} -F $OBJ/ssh_proxy -1 -c $c somehost true
     30 	if [ $? -ne 0 ]; then
     31 		fail "ssh -1 failed with cipher $c"
     32 	fi
     33 done
     34 
     35 if ${SSH} -oCiphers=acss@openssh.org 2>&1 | grep "Bad SSH2 cipher" >/dev/null
     36 then
     37 	:
     38 else
     39 
     40 echo "Ciphers acss (at] openssh.org" >> $OBJ/sshd_proxy
     41 c=acss@openssh.org
     42 for m in $macs; do
     43 	trace "proto 2 $c mac $m"
     44 	verbose "test $tid: proto 2 cipher $c mac $m"
     45 	${SSH} -F $OBJ/ssh_proxy -2 -m $m -c $c somehost true
     46 	if [ $? -ne 0 ]; then
     47 		fail "ssh -2 failed with mac $m cipher $c"
     48 	fi
     49 done
     50 
     51 fi
     52