summaryrefslogtreecommitdiff
path: root/regress/usr.bin/ssh
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2019-07-23 13:32:49 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2019-07-23 13:32:49 +0000
commit6f1a9c6796a74f04601ae2bea8d77409cb09a232 (patch)
tree9df35a45a08c4d632fe6140238ddac9571bed67d /regress/usr.bin/ssh
parent5285267d1051a03fce0579cb287d15585c316064 (diff)
Only use DSA key type in tests if binaries support it.
Diffstat (limited to 'regress/usr.bin/ssh')
-rw-r--r--regress/usr.bin/ssh/sshcfgparse.sh29
1 files changed, 19 insertions, 10 deletions
diff --git a/regress/usr.bin/ssh/sshcfgparse.sh b/regress/usr.bin/ssh/sshcfgparse.sh
index e0ce568d71c..2c00b64efc0 100644
--- a/regress/usr.bin/ssh/sshcfgparse.sh
+++ b/regress/usr.bin/ssh/sshcfgparse.sh
@@ -1,8 +1,15 @@
-# $OpenBSD: sshcfgparse.sh,v 1.4 2018/07/04 13:51:12 djm Exp $
+# $OpenBSD: sshcfgparse.sh,v 1.5 2019/07/23 13:32:48 dtucker Exp $
# Placed in the Public Domain.
tid="ssh config parse"
+dsa=0
+for t in $SSH_KEYTYPES; do
+ case "$t" in
+ ssh-dss) dsa=1 ;;
+ esac
+done
+
expect_result_present() {
_str="$1" ; shift
for _expect in "$@" ; do
@@ -75,15 +82,17 @@ f=`${SSH} -GF none -opubkeyacceptedkeytypes=-ssh-ed25519 host | \
expect_result_present "$f" "ssh-ed25519-cert-v01.*"
expect_result_absent "$f" "ssh-ed25519" "ssh-dss"
# Append to default set.
-# XXX this will break for !WITH_OPENSSL
-f=`${SSH} -GF none -opubkeyacceptedkeytypes=+ssh-dss-cert* host | \
- awk '/^pubkeyacceptedkeytypes /{print $2}'`
-expect_result_present "$f" "ssh-ed25519" "ssh-dss-cert-v01.*"
-expect_result_absent "$f" "ssh-dss"
-f=`${SSH} -GF none -opubkeyacceptedkeytypes=+ssh-dss host | \
- awk '/^pubkeyacceptedkeytypes /{print $2}'`
-expect_result_present "$f" "ssh-ed25519" "ssh-ed25519-cert-v01.*" "ssh-dss"
-expect_result_absent "$f" "ssh-dss-cert-v01.*"
+# This is not tested when built !WITH_OPENSSL
+if [ "$dsa" = "1" ]; then
+ f=`${SSH} -GF none -opubkeyacceptedkeytypes=+ssh-dss-cert* host | \
+ awk '/^pubkeyacceptedkeytypes /{print $2}'`
+ expect_result_present "$f" "ssh-ed25519" "ssh-dss-cert-v01.*"
+ expect_result_absent "$f" "ssh-dss"
+ f=`${SSH} -GF none -opubkeyacceptedkeytypes=+ssh-dss host | \
+ awk '/^pubkeyacceptedkeytypes /{print $2}'`
+ expect_result_present "$f" "ssh-ed25519" "ssh-ed25519-cert-v01.*" "ssh-dss"
+ expect_result_absent "$f" "ssh-dss-cert-v01.*"
+fi
# cleanup
rm -f $OBJ/ssh_config.[012]