diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2021-07-24 02:57:29 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2021-07-24 02:57:29 +0000 |
commit | 50fab5723926b96f5c5f22d2c24b3e2a2ab98164 (patch) | |
tree | 33bd6d667bacc54c642d437030ad4c861f4fa320 /regress | |
parent | 783f81dabcc0b2a5a933874e447c1b64204b4ee1 (diff) |
Skip RFC4716 format import and export tests when built without OpenSSL.
Diffstat (limited to 'regress')
-rw-r--r-- | regress/usr.bin/ssh/keygen-convert.sh | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/regress/usr.bin/ssh/keygen-convert.sh b/regress/usr.bin/ssh/keygen-convert.sh index e0cb4654d8e..95656581c5b 100644 --- a/regress/usr.bin/ssh/keygen-convert.sh +++ b/regress/usr.bin/ssh/keygen-convert.sh @@ -1,4 +1,4 @@ -# $OpenBSD: keygen-convert.sh,v 1.5 2021/07/23 05:53:02 dtucker Exp $ +# $OpenBSD: keygen-convert.sh,v 1.6 2021/07/24 02:57:28 dtucker Exp $ # Placed in the Public Domain. tid="convert keys" @@ -9,30 +9,36 @@ echo hunter2 EOD chmod u+x $OBJ/askpass +if ${SSHKEYGEN} -? 2>&1 | grep "ssh-keygen -e" >/dev/null; then + test_import_export=1 +fi + for t in ${SSH_KEYTYPES}; do # generate user key for agent trace "generating $t key" rm -f $OBJ/$t-key ${SSHKEYGEN} -q -N "" -t $t -f $OBJ/$t-key - trace "export $t private to rfc4716 public" - ${SSHKEYGEN} -q -e -f $OBJ/$t-key >$OBJ/$t-key-rfc || \ - fail "export $t private to rfc4716 public" + if test "x$test_import_export" = "x1"; then + trace "export $t private to rfc4716 public" + ${SSHKEYGEN} -q -e -f $OBJ/$t-key >$OBJ/$t-key-rfc || \ + fail "export $t private to rfc4716 public" - trace "export $t public to rfc4716 public" - ${SSHKEYGEN} -q -e -f $OBJ/$t-key.pub >$OBJ/$t-key-rfc.pub || \ - fail "$t public to rfc4716 public" + trace "export $t public to rfc4716 public" + ${SSHKEYGEN} -q -e -f $OBJ/$t-key.pub >$OBJ/$t-key-rfc.pub || \ + fail "$t public to rfc4716 public" - cmp $OBJ/$t-key-rfc $OBJ/$t-key-rfc.pub || \ - fail "$t rfc4716 exports differ between public and private" + cmp $OBJ/$t-key-rfc $OBJ/$t-key-rfc.pub || \ + fail "$t rfc4716 exports differ between public and private" - trace "import $t rfc4716 public" - ${SSHKEYGEN} -q -i -f $OBJ/$t-key-rfc >$OBJ/$t-rfc-imported || \ - fail "$t import rfc4716 public" + trace "import $t rfc4716 public" + ${SSHKEYGEN} -q -i -f $OBJ/$t-key-rfc >$OBJ/$t-rfc-imported || \ + fail "$t import rfc4716 public" - cut -f1,2 -d " " $OBJ/$t-key.pub >$OBJ/$t-key-nocomment.pub - cmp $OBJ/$t-key-nocomment.pub $OBJ/$t-rfc-imported || \ - fail "$t imported differs from original" + cut -f1,2 -d " " $OBJ/$t-key.pub >$OBJ/$t-key-nocomment.pub + cmp $OBJ/$t-key-nocomment.pub $OBJ/$t-rfc-imported || \ + fail "$t imported differs from original" + fi trace "set passphrase $t" ${SSHKEYGEN} -q -p -P '' -N 'hunter2' -f $OBJ/$t-key >/dev/null || \ |