try-ciphers.sh revision 157016
1254147Sobrien# $OpenBSD: try-ciphers.sh,v 1.10 2005/05/24 04:10:54 djm Exp $ 2254147Sobrien# Placed in the Public Domain. 3254147Sobrien 4256381Smarkmtid="try ciphers" 5254147Sobrien 6254147Sobrienciphers="aes128-cbc 3des-cbc blowfish-cbc cast128-cbc 7254147Sobrien arcfour128 arcfour256 arcfour 8254147Sobrien aes192-cbc aes256-cbc rijndael-cbc@lysator.liu.se 9254147Sobrien aes128-ctr aes192-ctr aes256-ctr" 10254147Sobrienmacs="hmac-sha1 hmac-md5 hmac-sha1-96 hmac-md5-96" 11254147Sobrien 12254147Sobrienfor c in $ciphers; do 13254147Sobrien for m in $macs; do 14254147Sobrien trace "proto 2 cipher $c mac $m" 15254147Sobrien verbose "test $tid: proto 2 cipher $c mac $m" 16254147Sobrien ${SSH} -F $OBJ/ssh_proxy -2 -m $m -c $c somehost true 17254147Sobrien if [ $? -ne 0 ]; then 18254147Sobrien fail "ssh -2 failed with mac $m cipher $c" 19254147Sobrien fi 20254147Sobrien done 21254147Sobriendone 22254147Sobrien 23254147Sobrienciphers="3des blowfish" 24254147Sobrienfor c in $ciphers; do 25254147Sobrien trace "proto 1 cipher $c" 26254147Sobrien verbose "test $tid: proto 1 cipher $c" 27254147Sobrien ${SSH} -F $OBJ/ssh_proxy -1 -c $c somehost true 28254147Sobrien if [ $? -ne 0 ]; then 29254147Sobrien fail "ssh -1 failed with cipher $c" 30254147Sobrien fi 31254147Sobriendone 32256381Smarkm 33254147Sobrienif ${SSH} -oCiphers=acss@openssh.org 2>&1 | grep "Bad SSH2 cipher" >/dev/null 34255362Smarkmthen 35256381Smarkm : 36254147Sobrienelse 37256381Smarkm 38256381Smarkmecho "Ciphers acss@openssh.org" >> $OBJ/sshd_proxy 39255362Smarkmc=acss@openssh.org 40254147Sobrienfor m in $macs; do 41256381Smarkm trace "proto 2 $c mac $m" 42254147Sobrien verbose "test $tid: proto 2 cipher $c mac $m" 43255362Smarkm ${SSH} -F $OBJ/ssh_proxy -2 -m $m -c $c somehost true 44254147Sobrien if [ $? -ne 0 ]; then 45255362Smarkm fail "ssh -2 failed with mac $m cipher $c" 46255362Smarkm fi 47254147Sobriendone 48254147Sobrien 49254147Sobrienfi 50254147Sobrien