mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-27 07:44:29 +02:00
- dtucker@cvs.openbsd.org 2014/01/25 04:35:32
[regress/Makefile regress/dhgex.sh] Add a test for DH GEX sizes
This commit is contained in:
parent
1e2aa3d904
commit
b843923284
@ -19,8 +19,11 @@
|
|||||||
Don't use -q on sftp as it suppresses logging, instead redirect the
|
Don't use -q on sftp as it suppresses logging, instead redirect the
|
||||||
output to the regress logfile.
|
output to the regress logfile.
|
||||||
- dtucker@cvs.openbsd.org 2014/01/20 00:00:30
|
- dtucker@cvs.openbsd.org 2014/01/20 00:00:30
|
||||||
[sftp-chroot.sh]
|
[sregress/ftp-chroot.sh]
|
||||||
append to rather than truncating the log file
|
append to rather than truncating the log file
|
||||||
|
- dtucker@cvs.openbsd.org 2014/01/25 04:35:32
|
||||||
|
[regress/Makefile regress/dhgex.sh]
|
||||||
|
Add a test for DH GEX sizes
|
||||||
- (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
|
- (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
|
||||||
[contrib/suse/openssh.spec] Crank version numbers
|
[contrib/suse/openssh.spec] Crank version numbers
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $OpenBSD: Makefile,v 1.67 2013/12/06 13:52:46 markus Exp $
|
# $OpenBSD: Makefile,v 1.68 2014/01/25 04:35:32 dtucker Exp $
|
||||||
|
|
||||||
REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t-exec
|
REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t-exec
|
||||||
tests: $(REGRESS_TARGETS)
|
tests: $(REGRESS_TARGETS)
|
||||||
@ -23,6 +23,7 @@ LTESTS= connect \
|
|||||||
transfer \
|
transfer \
|
||||||
banner \
|
banner \
|
||||||
rekey \
|
rekey \
|
||||||
|
dhgex \
|
||||||
stderr-data \
|
stderr-data \
|
||||||
stderr-after-eof \
|
stderr-after-eof \
|
||||||
broken-pipe \
|
broken-pipe \
|
||||||
|
54
regress/dhgex.sh
Normal file
54
regress/dhgex.sh
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
# $OpenBSD: dhgex.sh,v 1.1 2014/01/25 04:35:32 dtucker Exp $
|
||||||
|
# Placed in the Public Domain.
|
||||||
|
|
||||||
|
tid="dhgex"
|
||||||
|
|
||||||
|
LOG=${TEST_SSH_LOGFILE}
|
||||||
|
rm -f ${LOG}
|
||||||
|
|
||||||
|
kexs=`${SSH} -Q kex | grep diffie-hellman-group-exchange`
|
||||||
|
|
||||||
|
ssh_test_dhgex()
|
||||||
|
{
|
||||||
|
bits="$1"; shift
|
||||||
|
cipher="$1"; shift
|
||||||
|
kex="$1"; shift
|
||||||
|
|
||||||
|
rm -f ${LOG}
|
||||||
|
opts="-oKexAlgorithms=$kex -oCiphers=$cipher"
|
||||||
|
groupsz="1024<$bits<8192"
|
||||||
|
verbose "$tid bits $bits $kex $cipher"
|
||||||
|
${SSH} ${opts} $@ -vvv -F ${OBJ}/ssh_proxy somehost true
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
fail "ssh failed ($@)"
|
||||||
|
fi
|
||||||
|
# check what we request
|
||||||
|
grep "SSH2_MSG_KEX_DH_GEX_REQUEST($groupsz) sent" ${LOG} >/dev/null
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
got=`egrep "SSH2_MSG_KEX_DH_GEX_REQUEST(.*) sent" ${LOG}`
|
||||||
|
fail "$tid unexpected GEX sizes, expected $groupsz, got $got"
|
||||||
|
fi
|
||||||
|
# check what we got (depends on contents of system moduli file)
|
||||||
|
gotbits="`awk '/bits set:/{print $4}' ${LOG} | head -1 | cut -f2 -d/`"
|
||||||
|
if [ "$gotbits" -lt "$bits" ]; then
|
||||||
|
fatal "$tid expected $bits bit group, got $gotbits"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check()
|
||||||
|
{
|
||||||
|
bits="$1"; shift
|
||||||
|
|
||||||
|
for c in $@; do
|
||||||
|
for k in $kexs; do
|
||||||
|
ssh_test_dhgex $bits $c $k
|
||||||
|
done
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
#check 2048 3des-cbc
|
||||||
|
check 3072 `${SSH} -Q cipher | grep 128`
|
||||||
|
check 3072 arcfour blowfish-cbc
|
||||||
|
check 7680 `${SSH} -Q cipher | grep 192`
|
||||||
|
check 8192 `${SSH} -Q cipher | grep 256`
|
||||||
|
check 8192 rijndael-cbc@lysator.liu.se chacha20-poly1305@openssh.com
|
Loading…
x
Reference in New Issue
Block a user