]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: Replace OPENSSL as the variable that points to the
authordtucker@openbsd.org <dtucker@openbsd.org>
Sun, 25 Jul 2021 12:13:03 +0000 (12:13 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Sun, 25 Jul 2021 12:35:24 +0000 (22:35 +1000)
openssl binary with OPENSSL_BIN.  This will allow us to use the OPENSSL
variable from mk.conf or the make(1) command line indicating if we're
building with our without OpenSSL, and ultimately get the regress tests
working in the OPENSSL=no configuration.

OpenBSD-Regress-ID: 2d788fade3264d7803e5b54cae8875963f688c4e

regress/agent-pkcs11.sh
regress/percent.sh
regress/ssh2putty.sh
regress/test-exec.sh

index c9bd9d3245a77755cc8122a8cb96efd56d73c62b..268a70de8885bd79c223fe73e86cf9d97ed51244 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: agent-pkcs11.sh,v 1.8 2021/05/24 10:25:18 dtucker Exp $
+#      $OpenBSD: agent-pkcs11.sh,v 1.9 2021/07/25 12:13:03 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_BIN genpkey -algorithm rsa > $RSA
+$OPENSSL_BIN pkcs8 -nocrypt -in $RSA |\
     softhsm2-util --slot "$slot" --label 01 --id 01 --pin "$TEST_SSH_PIN" --import /dev/stdin
-$OPENSSL genpkey \
+$OPENSSL_BIN genpkey \
     -genparam \
     -algorithm ec \
     -pkeyopt ec_paramgen_curve:prime256v1 |\
-    $OPENSSL genpkey \
+    $OPENSSL_BIN genpkey \
     -paramfile /dev/stdin > $EC
-$OPENSSL pkcs8 -nocrypt -in $EC |\
+$OPENSSL_BIN pkcs8 -nocrypt -in $EC |\
     softhsm2-util --slot "$slot" --label 02 --id 02 --pin "$TEST_SSH_PIN" --import /dev/stdin
 
 trace "start agent"
index a00a777daa2c8641038d5df998ae6abc8b99f3c3..7ed41845b5cfe1e6841daf3cd05dd84f3756009b 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: percent.sh,v 1.12 2021/05/24 10:25:18 dtucker Exp $
+#      $OpenBSD: percent.sh,v 1.13 2021/07/25 12:13:03 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_BIN sha1 | cut -f2 -d' '`
        trial $i '%%' '%'
        trial $i '%C' $HASH
        trial $i '%i' $USERID
index 7fcb3f0bfce017d60e587c9a76b9bdc47d0546c7..9b08310391ca0feb818f92a1402afa3cfbed0d68 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-#      $OpenBSD: ssh2putty.sh,v 1.8 2021/06/02 00:17:45 dtucker Exp $
+#      $OpenBSD: ssh2putty.sh,v 1.9 2021/07/25 12:13:03 dtucker Exp $
 
 if test "x$1" = "x" -o "x$2" = "x" -o "x$3" = "x" ; then
        echo "Usage: ssh2putty hostname port ssh-private-key"
@@ -10,7 +10,7 @@ HOST=$1
 PORT=$2
 KEYFILE=$3
 
-OPENSSL="${OPENSSL:-openssl}"
+OPENSSL_BIN="${OPENSSL_BIN:-openssl}"
 
 # XXX - support DSA keys too
 if grep "BEGIN RSA PRIVATE KEY" $KEYFILE >/dev/null 2>&1 ; then
@@ -21,13 +21,13 @@ else
 fi
 
 public_exponent=`
-       $OPENSSL rsa -noout -text -in $KEYFILE | grep ^publicExponent |
+       $OPENSSL_BIN 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_BIN rsa -noout -modulus -in $KEYFILE | grep ^Modulus= |
        sed 's/^Modulus=/0x/' | tr A-Z a-z
 `
 test $? -ne 0 && exit 1
index a06976fab810700f8c965d5067d9a18ca88151ad..706c532b347d4328a565cccdac6be46f4e36a50e 100644 (file)
@@ -100,7 +100,7 @@ CONCH=conch
 
 # Tools used by multiple tests
 NC=$OBJ/netcat
-OPENSSL="${OPENSSL:-openssl}"
+OPENSSL_BIN="${OPENSSL_BIN:-openssl}"
 
 if [ "x$TEST_SSH_SSH" != "x" ]; then
        SSH="${TEST_SSH_SSH}"
@@ -157,7 +157,7 @@ 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}"
+       OPENSSL_BIN="${TEST_SSH_OPENSSL}"
 fi
 
 # Path to sshd must be absolute for rexec
@@ -327,8 +327,8 @@ md5 () {
                cksum
        elif have_prog sum; then
                sum
-       elif [ -x ${OPENSSL} ]; then
-               ${OPENSSL} md5
+       elif [ -x ${OPENSSL_BIN} ]; then
+               ${OPENSSL_BIN} md5
        else
                wc -c
        fi