kextype.sh 589 B

12345678910111213141516171819202122232425
  1. # $OpenBSD: kextype.sh,v 1.6 2015/03/24 20:19:15 markus Exp $
  2. # Placed in the Public Domain.
  3. tid="login with different key exchange algorithms"
  4. TIME=/usr/bin/time
  5. cp $OBJ/sshd_proxy $OBJ/sshd_proxy_bak
  6. cp $OBJ/ssh_proxy $OBJ/ssh_proxy_bak
  7. # Make server accept all key exchanges.
  8. ALLKEX=$(${SSH} -Q kex)
  9. KEXOPT=$(echo $ALLKEX | tr ' ' ,)
  10. echo "KexAlgorithms=$KEXOPT" >> $OBJ/sshd_proxy
  11. tries="1 2 3 4"
  12. for k in $(${SSH} -Q kex); do
  13. verbose "kex $k"
  14. for i in $tries; do
  15. ${SSH} -F $OBJ/ssh_proxy -o KexAlgorithms=$k x true
  16. if [ $? -ne 0 ]; then
  17. fail "ssh kex $k"
  18. fi
  19. done
  20. done