-# $OpenBSD: Makefile,v 1.4 2016/11/06 11:56:43 inoguchi Exp $
+# $OpenBSD: Makefile,v 1.5 2018/02/06 02:31:13 tb Exp $
SUBDIR= options
.endfor
ssl-enc:
- sh ${.CURDIR}/testenc.sh ${.OBJDIR} ${.CURDIR}
+ env OPENSSL=${OPENSSL} sh ${.CURDIR}/testenc.sh ${.OBJDIR} ${.CURDIR}
ssl-dsa:
- sh ${.CURDIR}/testdsa.sh ${.OBJDIR} ${.CURDIR}
+ env OPENSSL=${OPENSSL} sh ${.CURDIR}/testdsa.sh ${.OBJDIR} ${.CURDIR}
ssl-rsa:
- sh ${.CURDIR}/testrsa.sh ${.OBJDIR} ${.CURDIR}
+ env OPENSSL=${OPENSSL} sh ${.CURDIR}/testrsa.sh ${.OBJDIR} ${.CURDIR}
appstest:
- sh ${.CURDIR}/appstest.sh ${.OBJDIR} ${.CURDIR}
+ env OPENSSL=${OPENSSL} sh ${.CURDIR}/appstest.sh ${.OBJDIR} ${.CURDIR}
clean:
rm -rf ${CLEANFILES}
# output : all files generated by this script go under $ssldir
#
-openssl_bin=/usr/bin/openssl
+openssl_bin=${OPENSSL:-/usr/bin/openssl}
uname_s=`uname -s | grep 'MINGW'`
if [ "$uname_s" = "" ] ; then
#!/bin/sh
-# $OpenBSD: test_client.sh,v 1.1 2014/08/26 17:50:07 jsing Exp $
+# $OpenBSD: test_client.sh,v 1.2 2018/02/06 02:31:13 tb Exp $
echo
echo This starts a tls1 mode client to talk to the server run by
echo be echoed by the server.
echo
echo
-/usr/bin/openssl s_client -tls1
+${OPENSSL:-/usr/bin/openssl} s_client -tls1
#!/bin/sh
-# $OpenBSD: test_server.sh,v 1.1 2014/08/26 17:50:07 jsing Exp $
+# $OpenBSD: test_server.sh,v 1.2 2018/02/06 02:31:13 tb Exp $
echo This starts a tls1 mode server using the DSA certificate in ./server.pem
echo Run ./testclient.sh in another window and type at it, you should
echo should echo in this window
echo
echo
-/usr/bin/openssl s_server -tls1 -key testdsa.key -cert testdsa.pem
+${OPENSSL:-/usr/bin/openssl} s_server -tls1 -key testdsa.key -cert testdsa.pem
#!/bin/sh
-# $OpenBSD: testdsa.sh,v 1.1 2014/08/26 17:50:07 jsing Exp $
+# $OpenBSD: testdsa.sh,v 1.2 2018/02/06 02:31:13 tb Exp $
#Test DSA certificate generation of openssl
cd $1
# Generate DSA paramter set
-openssl dsaparam 512 -out dsa512.pem
+openssl_bin=${OPENSSL:-/usr/bin/openssl}
+$openssl_bin dsaparam 512 -out dsa512.pem
if [ $? != 0 ]; then
exit 1;
fi
# Denerate a DSA certificate
-openssl req -config $2/openssl.cnf -x509 -newkey dsa:dsa512.pem -out testdsa.pem -keyout testdsa.key
+$openssl_bin req -config $2/openssl.cnf -x509 -newkey dsa:dsa512.pem -out testdsa.pem -keyout testdsa.key
if [ $? != 0 ]; then
exit 1;
fi
# Now check the certificate
-openssl x509 -text -in testdsa.pem
+$openssl_bin x509 -text -in testdsa.pem
if [ $? != 0 ]; then
exit 1;
fi
#!/bin/sh
-# $OpenBSD: testenc.sh,v 1.1 2014/08/26 17:50:07 jsing Exp $
+# $OpenBSD: testenc.sh,v 1.2 2018/02/06 02:31:13 tb Exp $
testsrc=$2/openssl.cnf
test=$1/p
-cmd=/usr/bin/openssl
+cmd=${OPENSSL:-/usr/bin/openssl}
cd $1
#!/bin/sh
-# $OpenBSD: testrsa.sh,v 1.1 2014/08/26 17:50:07 jsing Exp $
+# $OpenBSD: testrsa.sh,v 1.2 2018/02/06 02:31:13 tb Exp $
#Test RSA certificate generation of openssl
cd $1
+openssl_bin=${OPENSSL:-/usr/bin/openssl}
# Generate RSA private key
-openssl genrsa -out rsakey.pem
+$openssl_bin genrsa -out rsakey.pem
if [ $? != 0 ]; then
exit 1;
fi
# Generate an RSA certificate
-openssl req -config $2/openssl.cnf -key rsakey.pem -new -x509 -days 365 -out rsacert.pem
+$openssl_bin req -config $2/openssl.cnf -key rsakey.pem -new -x509 -days 365 -out rsacert.pem
if [ $? != 0 ]; then
exit 1;
fi
# Now check the certificate
-openssl x509 -text -in rsacert.pem
+$openssl_bin x509 -text -in rsacert.pem
if [ $? != 0 ]; then
exit 1;
fi