summaryrefslogtreecommitdiff
path: root/regress/sshcfgparse.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/sshcfgparse.sh')
-rw-r--r--regress/sshcfgparse.sh29
1 files changed, 19 insertions, 10 deletions
diff --git a/regress/sshcfgparse.sh b/regress/sshcfgparse.sh
index e0ce568d7..2c00b64ef 100644
--- a/regress/sshcfgparse.sh
+++ b/regress/sshcfgparse.sh
@@ -1,8 +1,15 @@
1# $OpenBSD: sshcfgparse.sh,v 1.4 2018/07/04 13:51:12 djm Exp $ 1# $OpenBSD: sshcfgparse.sh,v 1.5 2019/07/23 13:32:48 dtucker Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="ssh config parse" 4tid="ssh config parse"
5 5
6dsa=0
7for t in $SSH_KEYTYPES; do
8 case "$t" in
9 ssh-dss) dsa=1 ;;
10 esac
11done
12
6expect_result_present() { 13expect_result_present() {
7 _str="$1" ; shift 14 _str="$1" ; shift
8 for _expect in "$@" ; do 15 for _expect in "$@" ; do
@@ -75,15 +82,17 @@ f=`${SSH} -GF none -opubkeyacceptedkeytypes=-ssh-ed25519 host | \
75expect_result_present "$f" "ssh-ed25519-cert-v01.*" 82expect_result_present "$f" "ssh-ed25519-cert-v01.*"
76expect_result_absent "$f" "ssh-ed25519" "ssh-dss" 83expect_result_absent "$f" "ssh-ed25519" "ssh-dss"
77# Append to default set. 84# Append to default set.
78# XXX this will break for !WITH_OPENSSL 85# This is not tested when built !WITH_OPENSSL
79f=`${SSH} -GF none -opubkeyacceptedkeytypes=+ssh-dss-cert* host | \ 86if [ "$dsa" = "1" ]; then
80 awk '/^pubkeyacceptedkeytypes /{print $2}'` 87 f=`${SSH} -GF none -opubkeyacceptedkeytypes=+ssh-dss-cert* host | \
81expect_result_present "$f" "ssh-ed25519" "ssh-dss-cert-v01.*" 88 awk '/^pubkeyacceptedkeytypes /{print $2}'`
82expect_result_absent "$f" "ssh-dss" 89 expect_result_present "$f" "ssh-ed25519" "ssh-dss-cert-v01.*"
83f=`${SSH} -GF none -opubkeyacceptedkeytypes=+ssh-dss host | \ 90 expect_result_absent "$f" "ssh-dss"
84 awk '/^pubkeyacceptedkeytypes /{print $2}'` 91 f=`${SSH} -GF none -opubkeyacceptedkeytypes=+ssh-dss host | \
85expect_result_present "$f" "ssh-ed25519" "ssh-ed25519-cert-v01.*" "ssh-dss" 92 awk '/^pubkeyacceptedkeytypes /{print $2}'`
86expect_result_absent "$f" "ssh-dss-cert-v01.*" 93 expect_result_present "$f" "ssh-ed25519" "ssh-ed25519-cert-v01.*" "ssh-dss"
94 expect_result_absent "$f" "ssh-dss-cert-v01.*"
95fi
87 96
88# cleanup 97# cleanup
89rm -f $OBJ/ssh_config.[012] 98rm -f $OBJ/ssh_config.[012]