1 # $OpenBSD: dhgex.sh,v 1.1 2014/01/25 04:35:32 dtucker Exp $
2 # Placed in the Public Domain.
6 LOG=${TEST_SSH_LOGFILE}
9 kexs=`${SSH} -Q kex | grep diffie-hellman-group-exchange`
18 opts="-oKexAlgorithms=$kex -oCiphers=$cipher"
19 groupsz="1024<$bits<8192"
20 verbose "$tid bits $bits $kex $cipher"
21 ${SSH} ${opts} $@ -vvv -F ${OBJ}/ssh_proxy somehost true
23 fail "ssh failed ($@)"
25 # check what we request
26 grep "SSH2_MSG_KEX_DH_GEX_REQUEST($groupsz) sent" ${LOG} >/dev/null
28 got=`egrep "SSH2_MSG_KEX_DH_GEX_REQUEST(.*) sent" ${LOG}`
29 fail "$tid unexpected GEX sizes, expected $groupsz, got $got"
31 # check what we got (depends on contents of system moduli file)
32 gotbits="`awk '/bits set:/{print $4}' ${LOG} | head -1 | cut -f2 -d/`"
33 if [ "$gotbits" -lt "$bits" ]; then
34 fatal "$tid expected $bits bit group, got $gotbits"
44 ssh_test_dhgex $bits $c $k
50 check 3072 `${SSH} -Q cipher | grep 128`
51 check 3072 arcfour blowfish-cbc
52 check 7680 `${SSH} -Q cipher | grep 192`
53 check 8192 `${SSH} -Q cipher | grep 256`
54 check 8192 rijndael-cbc@lysator.liu.se chacha20-poly1305@openssh.com