summaryrefslogtreecommitdiff
path: root/regress/usr.bin/ssh
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2016-05-03 12:15:50 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2016-05-03 12:15:50 +0000
commit4eddba62757c380d64cb368c64eef920d18e4c5b (patch)
tree7ecbe93c35645f7fdb5bdb8032b8dd392a999c75 /regress/usr.bin/ssh
parenta2b1df34a139d5602dcfd6ab124e4ae01a4e7fce (diff)
Use a subshell for constructing key types to work around different sed
behaviours for -portable.
Diffstat (limited to 'regress/usr.bin/ssh')
-rw-r--r--regress/usr.bin/ssh/cert-userkey.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/regress/usr.bin/ssh/cert-userkey.sh b/regress/usr.bin/ssh/cert-userkey.sh
index 605cf70529b..31974639591 100644
--- a/regress/usr.bin/ssh/cert-userkey.sh
+++ b/regress/usr.bin/ssh/cert-userkey.sh
@@ -1,4 +1,4 @@
-# $OpenBSD: cert-userkey.sh,v 1.15 2016/05/02 09:52:00 djm Exp $
+# $OpenBSD: cert-userkey.sh,v 1.16 2016/05/03 12:15:49 dtucker Exp $
# Placed in the Public Domain.
tid="certified user keys"
@@ -16,9 +16,10 @@ fi
kname() {
case $ktype in
rsa-sha2-*) ;;
- *) echo -n $1 | sed 's/^dsa/ssh-dss/;s/^rsa/ssh-rsa/;s/^ed/ssh-ed/' ;;
+ # subshell because some seds will add a newline
+ *) n=$(echo $1 | sed 's/^dsa/ssh-dss/;s/^rsa/ssh-rsa/;s/^ed/ssh-ed/') ;;
esac
- echo "*,ssh-rsa*,ssh-ed25519*"
+ echo "$n*,ssh-rsa*,ssh-ed25519*"
}
# Create a CA key