upstream: Find openssl binary via environment variable. This

allows overriding if necessary (eg in -portable where we're testing against a
specific version of OpenSSL).

OpenBSD-Regress-ID: 491f39cae9e762c71aa4bf045803d077139815c5
This commit is contained in:
dtucker@openbsd.org 2021-05-24 10:25:18 +00:00 committed by Damien Miller
parent 1a4d1da918
commit 07660b3c99
4 changed files with 16 additions and 12 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: agent-pkcs11.sh,v 1.7 2019/11/26 23:43:10 djm Exp $
# $OpenBSD: agent-pkcs11.sh,v 1.8 2021/05/24 10:25:18 dtucker Exp $
# Placed in the Public Domain.
tid="pkcs11 agent test"
@ -62,16 +62,16 @@ notty() {
trace "generating keys"
RSA=${DIR}/RSA
EC=${DIR}/EC
openssl genpkey -algorithm rsa > $RSA
openssl pkcs8 -nocrypt -in $RSA |\
$OPENSSL genpkey -algorithm rsa > $RSA
$OPENSSL pkcs8 -nocrypt -in $RSA |\
softhsm2-util --slot "$slot" --label 01 --id 01 --pin "$TEST_SSH_PIN" --import /dev/stdin
openssl genpkey \
$OPENSSL genpkey \
-genparam \
-algorithm ec \
-pkeyopt ec_paramgen_curve:prime256v1 |\
openssl genpkey \
$OPENSSL genpkey \
-paramfile /dev/stdin > $EC
openssl pkcs8 -nocrypt -in $EC |\
$OPENSSL pkcs8 -nocrypt -in $EC |\
softhsm2-util --slot "$slot" --label 02 --id 02 --pin "$TEST_SSH_PIN" --import /dev/stdin
trace "start agent"

View File

@ -1,4 +1,4 @@
# $OpenBSD: percent.sh,v 1.11 2021/02/05 22:03:40 dtucker Exp $
# $OpenBSD: percent.sh,v 1.12 2021/05/24 10:25:18 dtucker Exp $
# Placed in the Public Domain.
tid="percent expansions"
@ -79,7 +79,7 @@ for i in matchexec localcommand remotecommand controlpath identityagent \
fi
# Matches implementation in readconf.c:ssh_connection_hash()
HASH=`printf "${HOSTNAME}127.0.0.1${PORT}$REMUSER" |
openssl sha1 | cut -f2 -d' '`
$OPENSSL sha1 | cut -f2 -d' '`
trial $i '%%' '%'
trial $i '%C' $HASH
trial $i '%i' $USERID

View File

@ -1,5 +1,5 @@
#!/bin/sh
# $OpenBSD: ssh2putty.sh,v 1.5 2019/11/21 05:18:47 tb Exp $
# $OpenBSD: ssh2putty.sh,v 1.6 2021/05/24 10:25:18 dtucker Exp $
if test "x$1" = "x" -o "x$2" = "x" -o "x$3" = "x" ; then
echo "Usage: ssh2putty hostname port ssh-private-key"
@ -19,13 +19,13 @@ else
fi
public_exponent=`
openssl rsa -noout -text -in $KEYFILE | grep ^publicExponent |
$OPENSSL rsa -noout -text -in $KEYFILE | grep ^publicExponent |
sed 's/.*(//;s/).*//'
`
test $? -ne 0 && exit 1
modulus=`
openssl rsa -noout -modulus -in $KEYFILE | grep ^Modulus= |
$OPENSSL rsa -noout -modulus -in $KEYFILE | grep ^Modulus= |
sed 's/^Modulus=/0x/' | tr A-Z a-z
`
test $? -ne 0 && exit 1

View File

@ -1,4 +1,4 @@
# $OpenBSD: test-exec.sh,v 1.79 2021/04/06 23:57:56 dtucker Exp $
# $OpenBSD: test-exec.sh,v 1.80 2021/05/24 10:25:18 dtucker Exp $
# Placed in the Public Domain.
#SUDO=sudo
@ -100,6 +100,7 @@ CONCH=conch
# Tools used by multiple tests
NC=$OBJ/netcat
OPENSSL=openssl
if [ "x$TEST_SSH_SSH" != "x" ]; then
SSH="${TEST_SSH_SSH}"
@ -155,6 +156,9 @@ fi
if [ "x$TEST_SSH_SK_HELPER" != "x" ]; then
SSH_SK_HELPER="${TEST_SSH_SK_HELPER}"
fi
if [ "x$TEST_SSH_OPENSSL" != "x" ]; then
OPENSSL="${TEST_SSH_OPENSSL}"
fi
# Path to sshd must be absolute for rexec
case "$SSHD" in