diff options
author | dtucker@openbsd.org <dtucker@openbsd.org> | 2019-09-27 05:25:12 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@dtucker.net> | 2019-09-27 15:36:22 +1000 |
commit | 4d59f7a5169c451ebf559aedec031ac9da2bf80c (patch) | |
tree | fbb354389fd382a6737e17c180788f8040337d94 | |
parent | 7c817d129e2d48fc8a6f7965339313023ec45765 (diff) |
upstream: Test for empty result in expected bits. Remove CRs from log
as they confuse tools on some platforms. Re-enable the 3des-cbc test.
OpenBSD-Regress-ID: edf536d4f29fc1ba412889b37247a47f1b49d250
-rw-r--r-- | regress/dhgex.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/regress/dhgex.sh b/regress/dhgex.sh index 61fc178e8..ceb3b5d23 100644 --- a/regress/dhgex.sh +++ b/regress/dhgex.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: dhgex.sh,v 1.4 2017/05/08 01:52:49 djm Exp $ | 1 | # $OpenBSD: dhgex.sh,v 1.5 2019/09/27 05:25:12 dtucker Exp $ |
2 | # Placed in the Public Domain. | 2 | # Placed in the Public Domain. |
3 | 3 | ||
4 | tid="dhgex" | 4 | tid="dhgex" |
@@ -28,15 +28,19 @@ ssh_test_dhgex() | |||
28 | if [ $? -ne 0 ]; then | 28 | if [ $? -ne 0 ]; then |
29 | fail "ssh failed ($@)" | 29 | fail "ssh failed ($@)" |
30 | fi | 30 | fi |
31 | # Remove CRs. | ||
32 | sed 's/\r//' ${LOG} >${LOG}.new | ||
33 | mv ${LOG}.new ${LOG} | ||
31 | # check what we request | 34 | # check what we request |
32 | grep "SSH2_MSG_KEX_DH_GEX_REQUEST($groupsz) sent" ${LOG} >/dev/null | 35 | grep "SSH2_MSG_KEX_DH_GEX_REQUEST($groupsz) sent" ${LOG} >/dev/null |
33 | if [ $? != 0 ]; then | 36 | if [ $? != 0 ]; then |
34 | got=`egrep "SSH2_MSG_KEX_DH_GEX_REQUEST(.*) sent" ${LOG}` | 37 | got=`egrep "SSH2_MSG_KEX_DH_GEX_REQUEST(.*) sent" ${LOG}` |
35 | fail "$tid unexpected GEX sizes, expected $groupsz, got $got" | 38 | fail "$tid unexpected GEX sizes, expected $groupsz, got $got" |
36 | fi | 39 | fi |
37 | # check what we got (depends on contents of system moduli file) | 40 | # check what we got. |
38 | gotbits="`awk '/bits set:/{print $4}' ${LOG} | head -1 | cut -f2 -d/`" | 41 | gotbits="`awk '/bits set:/{print $4}' ${LOG} | head -1 | cut -f2 -d/`" |
39 | if [ "$gotbits" -lt "$bits" ]; then | 42 | trace "expected '$bits' got '$gotbits'" |
43 | if [ -z "$gotbits" ] || [ "$gotbits" -lt "$bits" ]; then | ||
40 | fatal "$tid expected $bits bit group, got $gotbits" | 44 | fatal "$tid expected $bits bit group, got $gotbits" |
41 | fi | 45 | fi |
42 | } | 46 | } |
@@ -52,7 +56,7 @@ check() | |||
52 | done | 56 | done |
53 | } | 57 | } |
54 | 58 | ||
55 | #check 2048 3des-cbc | 59 | check 3072 3des-cbc # 112 bits. |
56 | check 3072 `${SSH} -Q cipher | grep 128` | 60 | check 3072 `${SSH} -Q cipher | grep 128` |
57 | check 7680 `${SSH} -Q cipher | grep 192` | 61 | check 7680 `${SSH} -Q cipher | grep 192` |
58 | check 8192 `${SSH} -Q cipher | grep 256` | 62 | check 8192 `${SSH} -Q cipher | grep 256` |