diff --git a/dev/easytls-op-test.bat b/dev/easytls-op-test.bat index f592a2d..e6bbe34 100644 --- a/dev/easytls-op-test.bat +++ b/dev/easytls-op-test.bat @@ -50,20 +50,20 @@ dir cd .. if %PROCESSOR_ARCHITECTURE% == x86 ( - curl -LO https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.8/EasyRSA-3.0.8-win32.zip - 7z e -aoa EasyRSA-3.0.8-win32.zip + curl -LO https://github.com/OpenVPN/easy-rsa/releases/download/v3.1.6/EasyRSA-3.1.6-win32.zip + 7z e -aoa EasyRSA-3.1.6-win32.zip REM ping -n 10 127.0.0.1 curl -LO https://github.com/TinCanTech/Prebuilt-Openvpn/raw/master/wovpn/wovpn32b.zip 7z e -aoa wovpn32b.zip ) ELSE ( - curl -LO https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.8/EasyRSA-3.0.8-win64.zip - 7z e -aoa EasyRSA-3.0.8-win64.zip + curl -LO https://github.com/OpenVPN/easy-rsa/releases/download/v3.1.6/EasyRSA-3.1.6-win64.zip + 7z e -aoa EasyRSA-3.1.6-win64.zip REM ping -n 10 127.0.0.1 curl -LO https://github.com/TinCanTech/Prebuilt-Openvpn/raw/master/wovpn/wovpn64b.zip 7z e -aoa wovpn64b.zip ) -curl -LO https://raw.githubusercontent.com/TinCanTech/easyrsa-plus/master/easyrsa3/easyrsa +REM curl -LO https://raw.githubusercontent.com/TinCanTech/easyrsa-plus/master/easyrsa3/easyrsa SET PATH=%PATH%;.\ SET HOME=%PATH% diff --git a/dev/easytls-op-test.sh b/dev/easytls-op-test.sh index 0a7bd3e..bd1fdc2 100755 --- a/dev/easytls-op-test.sh +++ b/dev/easytls-op-test.sh @@ -63,14 +63,17 @@ done cd "${etls_ut_dir_name}" -dl_ossl3 +#dl_ossl3 CURL_TARGET="https://raw.githubusercontent.com/TinCanTech/easy-rsa/master/easyrsa3/easyrsa" curl -O "$CURL_TARGET" || exit 77 + CURL_TARGET="https://raw.githubusercontent.com/TinCanTech/easy-rsa/master/easyrsa3/openssl-easyrsa.cnf" curl -O "$CURL_TARGET" || exit 77 + CURL_TARGET="https://raw.githubusercontent.com/TinCanTech/Prebuilt-OpenVPN/master/src/openvpn/openvpn" curl -O "$CURL_TARGET" || exit 77 + echo for f in ./easyrsa ./openssl-easyrsa.cnf ./openvpn @@ -93,7 +96,8 @@ ls -l export EASYTLS_OPENVPN="./openvpn" printf "%s\n" "EASYTLS_OPENVPN=$EASYTLS_OPENVPN" - export EASYRSA_OPENSSL="./openssl" + #export EASYRSA_OPENSSL="./openssl" + export EASYRSA_OPENSSL="openssl" printf "%s\n" "EASYRSA_OPENSSL=$EASYRSA_OPENSSL" $EASYTLS_OPENVPN --version diff --git a/dev/easytls-unit-tests.sh b/dev/easytls-unit-tests.sh index 80f5b2f..b87ac98 100755 --- a/dev/easytls-unit-tests.sh +++ b/dev/easytls-unit-tests.sh @@ -25,6 +25,43 @@ usage () " } + +# Tools Version +tools_version() { + print " +OpenSSL command: ${OPENSSL_CMD}" + ${INVOKE_OPTS} "${OPENSSL_CMD}" version || \ + fail "${INVOKE_OPTS} ${OPENSSL_CMD} version ($exit_code)" + + print " +EasyRSA command: ${EASYRSA_CMD}" + ${INVOKE_OPTS} "${EASYRSA_CMD}" version || \ + fail "${INVOKE_OPTS} ${EASYRSA_CMD} version ($exit_code)" + + print " +EasyTLS command: ${EASYTLS_CMD}" + ${INVOKE_OPTS} "${EASYTLS_CMD}" -V || \ + fail "${INVOKE_OPTS} ${EASYTLS_CMD} -V ($exit_code)" + + print " +EasyTLS-cryptv2-verify command: ${TLSCV2V_CMD}" + ${INVOKE_OPTS} "${TLSCV2V_CMD}" -V || exit_code=$? + [ $exit_code -eq 9 ] || \ + fail "${INVOKE_OPTS} ${TLSCV2V_CMD} -V ($exit_code)" + + print " +EasyTLS-client-connect command: ${CLICON_CMD}" + ${INVOKE_OPTS} "${CLICON_CMD}" -V || exit_code=$? + [ $exit_code -eq 9 ] || \ + fail "${INVOKE_OPTS} ${CLICON_CMD} -V ($exit_code)" + + print " +EasyTLS-client-disconnect command: ${CLIDIS_CMD}" + ${INVOKE_OPTS} "${CLIDIS_CMD}" -V || exit_code=$? + [ $exit_code -eq 9 ] || \ + fail "${INVOKE_OPTS} ${CLIDIS_CMD} -V ($exit_code)" +} + fail () { print "$@" @@ -118,7 +155,9 @@ warn() { printf "%s\n" "$*"; } build_test_pki () { - for i in "--req-cn='easytls-unit-test' build-ca nopass" \ + for i in \ + "make-safe-ssl" \ + "--req-cn='easytls-unit-test' build-ca nopass" \ "build-server-full s01 nopass" \ "build-server-full s02 nopass" \ "build-server-full s-auth nopass" \ @@ -308,7 +347,7 @@ WORK_DIR="$(pwd)" UTMP_DIR="${WORK_DIR}/unit-test-tmp" rm -rf "${UTMP_DIR}" -EASYRSA_CMD="./easyrsa" +EASYRSA_CMD="${EASYRSA_CMD:-./easyrsa}" EASYRSA_OPTS="--batch" EASYTLS_CMD="./easytls" @@ -384,11 +423,18 @@ else export EASYTLS_OPENVPN=openvpn export OPENVPN_CMD=openvpn fi + + export EASYRSA_OPENSSL="openssl" + export OPENSSL_CMD="openssl" + fi # Invoke with user opts: eg. EASYTLS_SILENT=1 INVOKE_OPTS="" +# Version info +tools_version + # Test help print "TEST: All --help" @@ -476,7 +522,7 @@ print "Zero errors" export EASYRSA_CERT_RENEW=1000 -build_easyrsa +#build_easyrsa total_expected_errors=0 subtot_1=0 @@ -614,11 +660,13 @@ elif [ -n "${EASYTLS_REMOTE_CI}" ]; then # Update safessl-easyrsa.cnf print "*** Update safessl-easyrsa.cnf - easyrsa init-pki" - "${EASYRSA_CMD}" --pki-dir="${WORK_DIR}/et-tdir${loops}" --batch init-pki + "${EASYRSA_CMD}" --pki-dir="${WORK_DIR}/et-tdir${loops}" --batch init-pki || fail "init-pki" + "${EASYRSA_CMD}" --pki-dir="${WORK_DIR}/et-tdir${loops}" --batch make-safe-ssl cp -vf "${WORK_DIR}/et-tdir${loops}/safessl-easyrsa.cnf" ./safessl-easyrsa.cnf || \ fail "(1) cp ${WORK_DIR}/et-tdir${loops}/safessl-easyrsa.cnf ./safessl-easyrsa.cnf" + # Remove the temp PKI - Only require safessl-easyrsa.cnf rm -rf "${WORK_DIR}/et-tdir${loops}" @@ -1213,21 +1261,8 @@ DBUG_DIR="$WORK_DIR/et-tdir1/easytls/metadata" #"$EASYTLS_CMD" $EASYTLS_OPTS version || \ # fail "Unit test error 71: version" -# Version -${INVOKE_OPTS} "${EASYTLS_CMD}" -V || \ - fail "${INVOKE_OPTS} ${EASYTLS_CMD} -V ($exit_code)" - -${INVOKE_OPTS} "${TLSCV2V_CMD}" -V || exit_code=$? -[ $exit_code -eq 9 ] || \ - fail "${INVOKE_OPTS} ${TLSCV2V_CMD} -V ($exit_code)" - -${INVOKE_OPTS} "${CLICON_CMD}" -V || exit_code=$? -[ $exit_code -eq 9 ] || \ - fail "${INVOKE_OPTS} ${CLICON_CMD} -V ($exit_code)" - -${INVOKE_OPTS} "${CLIDIS_CMD}" -V || exit_code=$? -[ $exit_code -eq 9 ] || \ - fail "${INVOKE_OPTS} ${CLIDIS_CMD} -V ($exit_code)" +# Version info +tools_version # Stats unset EASYTLS_QUIET