]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: detect faketime at configure time
authorDaiki Ueno <ueno@gnu.org>
Wed, 5 Jul 2023 13:55:16 +0000 (15:55 +0200)
committerDaiki Ueno <ueno@gnu.org>
Wed, 12 Jul 2023 05:53:16 +0000 (07:53 +0200)
Previously, the test suite checked the existence of faketime or
datefudge at "make check", multiple times when it is needed.  This
moves the check to configure and check it only once.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
Co-authored-by: Andreas Metzler <ametzler@bebt.de>
63 files changed:
.gitignore
configure.ac
tests/Makefile.am
tests/cert-reencoding.sh
tests/cert-tests/Makefile.am
tests/cert-tests/alt-chain.sh
tests/cert-tests/cert-critical.sh
tests/cert-tests/cert-non-digits-time.sh
tests/cert-tests/certtool-eddsa.sh
tests/cert-tests/certtool-rsa-pss.sh
tests/cert-tests/certtool-verify-profiles.sh
tests/cert-tests/certtool.sh
tests/cert-tests/crl.sh
tests/cert-tests/crq.sh
tests/cert-tests/inhibit-anypolicy.sh
tests/cert-tests/invalid-sig.sh
tests/cert-tests/krb5-test.sh
tests/cert-tests/md5-test.sh
tests/cert-tests/name-constraints.sh
tests/cert-tests/othername-test.sh
tests/cert-tests/pkcs1-pad.sh
tests/cert-tests/pkcs7-cat.sh
tests/cert-tests/pkcs7-constraints.sh
tests/cert-tests/pkcs7-constraints2.sh
tests/cert-tests/pkcs7.sh
tests/cert-tests/rsa-pss-pad.sh
tests/cert-tests/sha3-test.sh
tests/cert-tests/smime.sh
tests/cert-tests/template-exts-test.sh
tests/cert-tests/template-policy-test.sh
tests/cert-tests/template-test.sh
tests/cert-tests/tlsfeature-test.sh
tests/certtool-pkcs11.sh
tests/datefudge-check.c [deleted file]
tests/gnutls-cli-debug.sh
tests/gnutls-cli-invalid-crl.sh
tests/gnutls-cli-self-signed.sh
tests/ocsp-tests/ocsp-load-chain.sh
tests/ocsp-tests/ocsp-must-staple-connection.sh
tests/ocsp-tests/ocsp-signer-verify.sh
tests/ocsp-tests/ocsp-test.sh
tests/ocsp-tests/ocsp-tls-connection.sh
tests/pkcs7-cat.sh
tests/rsa-md5-collision/rsa-md5-collision.sh
tests/scripts/common.sh
tests/server-multi-keys.sh
tests/server-weak-keys.sh
tests/suite/Makefile.am
tests/suite/testcompat-openssl-cli-compat.sh
tests/suite/testcompat-openssl-cli-no-etm.sh
tests/suite/testcompat-openssl-cli.sh
tests/suite/testcompat-openssl-serv-compat.sh
tests/suite/testcompat-openssl-serv-no-etm.sh
tests/suite/testcompat-openssl-serv-no-safe-renegotiation.sh
tests/suite/testcompat-openssl-serv-no-tickets.sh
tests/suite/testcompat-openssl-serv-safe-renegotiation.sh
tests/suite/testcompat-openssl-serv.sh
tests/suite/testcompat-polarssl-serv-compat.sh
tests/suite/testcompat-polarssl-serv-no-etm.sh
tests/suite/testcompat-polarssl-serv.sh
tests/system-override-profiles.sh
tests/system-override-tls.sh
tests/testpkcs11.sh

index 2b0725526e4409d9e3e90fa8f8c2e4cf33b965d3..1f25a9d9aeab0f6a9d74f99a3a5d7f47ef68bdf7 100644 (file)
@@ -366,7 +366,6 @@ tests/cve-2009-1415
 tests/cve-2009-1416
 tests/dane
 tests/dane-strcodes
-tests/datefudge-check
 tests/dh-compute
 tests/dh-params
 tests/dhepskself
index 7babfb36c8b59152bdbff8cf64907dd147d8879e..410a36791fd9df9db8d33286409e496e46251544 100644 (file)
@@ -65,6 +65,42 @@ AM_MISSING_PROG([GPERF], [gperf])
 AM_MISSING_PROG([ASN1PARSER], [asn1Parser])
 AM_MISSING_PROG([PERL], [perl])
 
+AC_CHECK_PROGS([FAKETIME], [faketime])
+AS_IF([test -n "$FAKETIME"], [FAKETIME_F_OPT="-f"; AC_SUBST([FAKETIME_F_OPT])], [
+  AC_CHECK_PROGS([DATEFUDGE], [datefudge])
+  AS_IF([test -n "$DATEFUDGE"], [
+    FAKETIME_F_OPT="-s"
+    AC_SUBST([FAKETIME], [$DATEFUDGE])
+    AC_SUBST([FAKETIME_F_OPT])
+  ])
+])
+
+AC_MSG_CHECKING([whether faketime program works])
+AC_RUN_IFELSE(
+  [AC_LANG_PROGRAM(
+    [[#include <stdio.h>
+      #include <stdlib.h>
+      #include <time.h>
+    ]],
+    [[time_t t = time(NULL);
+      struct tm *tmp = localtime(&t);
+      char outstr[200];
+      if (!tmp) return 0;
+      if (!strftime(outstr, sizeof(outstr), "%s", tmp)) return 0;
+      puts(outstr);
+      return 0;
+    ]])],
+  [AS_IF([test `TZ=UTC $FAKETIME $FAKETIME_F_OPT "2006-09-23 00:00:00" ./conftest$EXEEXT` = "1158969600"], [
+     ac_cv_faketime_works=yes
+   ], [
+     ac_cv_faketime_works=no
+   ])],
+  [ac_cv_faketime_works=no],
+  [ac_cv_faketime_works=cross-compiling])
+
+AC_MSG_RESULT([$ac_cv_faketime_works])
+AC_SUBST([ac_cv_faketime_works])
+
 AC_ARG_ENABLE(bash-tests,
   AS_HELP_STRING([--disable-bash-tests], [skip some tests that badly need bash]),
     enable_bash_tests=$enableval, enable_bash_tests=yes)
index e4bf3de3aeeb83cc66bd9b8f07e317ef5c743a7f..da83c45c6688dbcca5fd30becbdb7debe236178b 100644 (file)
@@ -604,11 +604,6 @@ sanity_cpp_CXXFLAGS = $(AM_CPPFLAGS) \
 endif
 endif
 
-if !WINDOWS
-indirect_tests += datefudge-check
-noinst_PROGRAMS = datefudge-check
-endif
-
 check_PROGRAMS = $(cpptests) $(ctests) $(indirect_tests)
 TESTS = $(cpptests) $(ctests) $(dist_check_SCRIPTS)
 
@@ -651,6 +646,11 @@ else
 TESTS_ENVIRONMENT += ENABLE_GOST=0
 endif
 
+TESTS_ENVIRONMENT +=                                   \
+       FAKETIME="$(FAKETIME)"                          \
+       FAKETIME_F_OPT="$(FAKETIME_F_OPT)"              \
+       ac_cv_faketime_works="$(ac_cv_faketime_works)"
+
 TEST_EXTENSIONS = .sh
 SH_LOG_COMPILER = $(SHELL)
 
index 804fe5652ac7ba537cb88bf92580187f9edad99b..6e14ac84b29b0e12254ce94ae12671d7a12a748a 100755 (executable)
@@ -243,13 +243,13 @@ TESTDATE="2018-03-01 00:00:00"
 # Start OpenSSL TLS server
 #
 launch_bare_server \
-         gnutls_timewrapper_standalone "${TESTDATE}" \
+         "$FAKETIME" "${TESTDATE}" \
          "${OPENSSL}" s_server -cert ${SERVER_CERT_FILE} -key ${SERVER_KEY_FILE} \
          -CAfile ${CA_FILE} -port ${PORT} -Verify 1 -verify_return_error -www
 SERVER_PID="${!}"
 wait_server "${SERVER_PID}"
 
-gnutls_timewrapper_standalone static "${TESTDATE}" \
+"$FAKETIME" "$FAKETIME_F_OPT" "${TESTDATE}" \
       "${CLI}" --x509certfile ${CLIENT_CERT_FILE} \
       --x509keyfile ${CLIENT_KEY_FILE} --x509cafile=${CA_FILE} \
       --port="${PORT}" localhost </dev/null
index 3df478449a81a9bf0d0d172a4158a5b957e59325..110503345aaac1cbba357946cb8ee1c54c542c67 100644 (file)
@@ -181,6 +181,11 @@ if DISABLE_BASH_TESTS
 TESTS_ENVIRONMENT += DISABLE_BASH_TESTS=1
 endif
 
+TESTS_ENVIRONMENT +=                                   \
+       FAKETIME="$(FAKETIME)"                          \
+       FAKETIME_F_OPT="$(FAKETIME_F_OPT)"              \
+       ac_cv_faketime_works="$(ac_cv_faketime_works)"
+
 AM_VALGRINDFLAGS = --suppressions=$(srcdir)/suppressions.valgrind
 LOG_COMPILER = $(LOG_VALGRIND)
 
index 177570e5814b16c1fd0c2f859a77b3e37a15bcff..c10e3edaec1137801c72bf3bed63b4a0e8ba8aaa 100755 (executable)
@@ -41,7 +41,7 @@ OLD_CA_FILE="${srcdir}/data/alt-chain-old-ca.pem"
 NEW_CA_FILE="${srcdir}/data/alt-chain-new-ca.pem"
 
 echo ""
-gnutls_timewrapper_standalone static "2017-05-10 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2017-05-10 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --load-ca-certificate ${OLD_CA_FILE} --verify-hostname www.google.com --verify --infile "${srcdir}/data/alt-chain.pem" >${OUTFILE}
 rc=$?
 
@@ -52,7 +52,7 @@ if test "${rc}" != "1"; then
 fi
 
 echo ""
-gnutls_timewrapper_standalone static "2017-05-10 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2017-05-10 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --load-ca-certificate ${NEW_CA_FILE} --verify-hostname www.google.com --verify --infile "${srcdir}/data/alt-chain.pem" >${OUTFILE}
 rc=$?
 
index d65a8e9ee2fbacda4f68e3a428f8c08e05d8ffd4..190377c958d77438ca73391ae36f85be56e1c4d3 100755 (executable)
@@ -37,7 +37,7 @@ export TZ="UTC"
 
 skip_if_no_datefudge
 
-gnutls_timewrapper_standalone "2017-2-28" \
+"$FAKETIME" "2017-2-28" \
 ${VALGRIND} "${CERTTOOL}" --verify-chain --infile ${srcdir}/data/chain-with-critical-on-root.pem
 rc=$?
 
@@ -46,7 +46,7 @@ if test "${rc}" != "1"; then
        exit 1
 fi
 
-gnutls_timewrapper_standalone "2017-2-28" \
+"$FAKETIME" "2017-2-28" \
 ${VALGRIND} "${CERTTOOL}" --verify-chain --infile ${srcdir}/data/chain-with-critical-on-endcert.pem
 rc=$?
 
@@ -55,7 +55,7 @@ if test "${rc}" != "1"; then
        exit 1
 fi
 
-gnutls_timewrapper_standalone "2017-2-28" \
+"$FAKETIME" "2017-2-28" \
 ${VALGRIND} "${CERTTOOL}" --verify-chain --infile ${srcdir}/data/chain-with-critical-on-intermediate.pem
 rc=$?
 
index 930cedd09a75cb1ddfc7d64ee9944c7cdfe3de8b..686a8ba36cd7ef24f8ee4cdd37a411cc33d00b60 100755 (executable)
@@ -34,7 +34,7 @@ fi
 skip_if_no_datefudge
 
 # Check whether certificates with non-digits time fields are accepted
-gnutls_timewrapper_standalone static "2019-12-19 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2019-12-19 00:00:00" \
 ${VALGRIND}"${CERTTOOL}" --verify --load-ca-certificate "${srcdir}/data/cert-with-non-digits-time-ca.pem" --infile "${srcdir}/data/cert-with-non-digits-time.pem"
 rc=$?
 
index be0c8e5d8d25cebe8ba1f9e8118a18d86d5de9f8..59ded9a6897b1415403630da10130cc6fbb16310 100755 (executable)
@@ -126,7 +126,7 @@ rm -f "${KEYFILE}"
 skip_if_no_datefudge
 
 # Test certificate chain using Ed25519
-gnutls_timewrapper_standalone "2017-7-6" \
+"$FAKETIME" "2017-7-6" \
 ${VALGRIND} "${CERTTOOL}" --verify-chain --infile ${srcdir}/data/chain-eddsa.pem
 
 if test $? != 0; then
index 8dccc4e257f348e2e79336da865176579b80434c..68f250d829a0124c3a46febb1d7cb5f98c275488 100755 (executable)
@@ -211,7 +211,7 @@ export TZ="UTC"
 
 skip_if_no_datefudge
 
-gnutls_timewrapper_standalone "2012-11-22" \
+"$FAKETIME" "2012-11-22" \
 ${VALGRIND} "${CERTTOOL}" --verify --load-ca-certificate "${srcdir}/data/cert-rsa-pss.pem" --infile "${srcdir}/data/cert-rsa-pss.pem"
 rc=$?
 
index 862b4459c40721ffba7a2ac4f72873e727f75232..82ebf9d1636da15541631e43ed8a3f5b159d08d8 100755 (executable)
@@ -38,7 +38,7 @@ OUTFILE=out-pkcs7.$$.tmp
 skip_if_no_datefudge
 
 echo "Checking chain with insecure leaf"
-gnutls_timewrapper_standalone static "2019-12-19 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2019-12-19 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --verify-chain --verify-profile=medium --infile "${srcdir}/data/chain-512-leaf.pem" >${OUTFILE}
 rc=$?
 
@@ -49,7 +49,7 @@ if test "${rc}" != "1"; then
 fi
 
 echo "Checking chain with insecure subca"
-gnutls_timewrapper_standalone static "2019-12-19 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2019-12-19 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --verify-chain --verify-profile=medium --infile "${srcdir}/data/chain-512-subca.pem" >${OUTFILE}
 rc=$?
 
@@ -61,7 +61,7 @@ fi
 
 
 echo "Checking chain with insecure ca"
-gnutls_timewrapper_standalone static "2019-12-19 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2019-12-19 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --verify-chain --verify-profile=medium --infile "${srcdir}/data/chain-512-ca.pem" >${OUTFILE}
 rc=$?
 
index 3ec820fad7a28d3cc1bfd5d31e2b0da5fad21130..0b7e3813a55da99840695d2b6bd234479124f56e 100755 (executable)
@@ -173,7 +173,7 @@ export TZ="UTC"
 
 skip_if_no_datefudge
 
-cat "${srcdir}/../certs/cert-ecc256.pem" "${srcdir}/../certs/ca-cert-ecc.pem"|gnutls_timewrapper_standalone "2012-11-22" \
+cat "${srcdir}/../certs/cert-ecc256.pem" "${srcdir}/../certs/ca-cert-ecc.pem"|"$FAKETIME" "2012-11-22" \
 ${VALGRIND} "${CERTTOOL}" --verify-chain
 rc=$?
 
index d097017473059fb145b92cbdcce052cc90461ff6..88e2eda1656017e2ffeb9d71efeeece9e0391e3b 100755 (executable)
@@ -172,7 +172,7 @@ export TZ="UTC"
 
 skip_if_no_datefudge
 
-gnutls_timewrapper_standalone static "2020-01-20 10:00:00" ${VALGRIND} \
+"$FAKETIME" "$FAKETIME_F_OPT" "2020-01-20 10:00:00" ${VALGRIND} \
        "${CERTTOOL}" --generate-crl --load-ca-privkey "${srcdir}/data/template-test.key" \
        --load-ca-certificate "${srcdir}/data/template-test.pem" \
        --load-certificate "${srcdir}/data/ca-certs.pem" --template \
@@ -194,7 +194,7 @@ fi
 
 if test "${ac_cv_sizeof_time_t}" = 8;then
        # we should test that on systems which have 64-bit time_t
-       gnutls_timewrapper_standalone static "2138-01-20 10:00:00" ${VALGRIND} \
+       "$FAKETIME" "$FAKETIME_F_OPT" "2138-01-20 10:00:00" ${VALGRIND} \
                "${CERTTOOL}" --generate-crl --load-ca-privkey "${srcdir}/data/template-test.key" \
                --load-ca-certificate "${srcdir}/data/template-test.pem" \
                --load-certificate "${srcdir}/data/ca-certs.pem" --template \
index d555fdb28927be9c0937c46013ecbbdaeefa0d28..97f6dee678d5764b06df5562761e3fe530fe9532 100755 (executable)
@@ -59,7 +59,7 @@ fi
 rm -f "${OUTFILE}"
 
 # check whether the honor_crq_extension option works
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-request \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-tlsfeature.tmpl" \
@@ -78,7 +78,7 @@ if grep -v '^-----BEGIN [A-Z0-9 ]\+-----$' ${TMPFILE} | grep -v '^[A-Za-z0-9/+=]
        exit 1
 fi
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-certificate \
                --load-ca-privkey "${srcdir}/data/template-test.key" \
                --load-ca-certificate "${srcdir}/data/template-tlsfeature.pem" \
@@ -130,7 +130,7 @@ N
 N
 __EOF__
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
 setsid \
        "${CERTTOOL}" -q \
                --load-privkey "${srcdir}/data/template-test.key" \
@@ -147,7 +147,7 @@ if test "${rc}" != "0"; then
 fi
 
 # check whether the generation with extension works
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-request \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/arb-extensions.tmpl" \
@@ -168,7 +168,7 @@ if test "${rc}" != "0"; then
 fi
 
 # Generate certificate from CRQ with no explicit extensions
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-certificate \
                --load-ca-privkey "${srcdir}/../../doc/credentials/x509/ca-key.pem" \
                --load-ca-certificate "${srcdir}/../../doc/credentials/x509/ca.pem" \
@@ -191,7 +191,7 @@ if test "${rc}" != "0"; then
 fi
 
 # Generate certificate from CRQ with CRQ extensions
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-certificate \
                --load-ca-privkey "${srcdir}/../../doc/credentials/x509/ca-key.pem" \
                --load-ca-certificate "${srcdir}/../../doc/credentials/x509/ca.pem" \
@@ -214,7 +214,7 @@ if test "${rc}" != "0"; then
 fi
 
 # Generate certificate from CRQ with explicit extensions
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-certificate \
                --load-ca-privkey "${srcdir}/../../doc/credentials/x509/ca-key.pem" \
                --load-ca-certificate "${srcdir}/../../doc/credentials/x509/ca.pem" \
index 398350da037208d632d4f708133a7d6d9c22362e..9aa47ddfd7d93495d2c2382979534ce0aeea444b 100755 (executable)
@@ -37,7 +37,7 @@ SUBCAFILE=inhibit-subca.$$.tmp
 
 skip_if_no_datefudge
 
-gnutls_timewrapper_standalone static "2017-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2017-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/key-ca.pem" \
                --template "${srcdir}/templates/inhibit-anypolicy.tmpl" \
@@ -56,7 +56,7 @@ fi
 echo ca > $TEMPLFILE
 echo "cn = sub-CA" >> $TEMPLFILE
 
-gnutls_timewrapper_standalone static "2017-04-23 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2017-04-23 00:00:00" \
 "${CERTTOOL}" -d 2 --generate-certificate --template $TEMPLFILE \
        --load-ca-privkey "${srcdir}/data/key-ca.pem" \
        --load-ca-certificate $CAFILE \
@@ -71,7 +71,7 @@ fi
 cat $SUBCAFILE $CAFILE > ${TMPFILE}
 
 # we do not support the inhibit any policy extension for verification
-gnutls_timewrapper_standalone static "2017-04-25 00:00:00" "${CERTTOOL}" --verify-chain --infile ${TMPFILE}
+"$FAKETIME" "$FAKETIME_F_OPT" "2017-04-25 00:00:00" "${CERTTOOL}" --verify-chain --infile ${TMPFILE}
 rc=$?
 if test "$rc" != "0"; then
        echo "Verification failed unexpectedly ($rc)"
index 663cf5b737dbbda08882ba41c74c20eed71899b9..c7673f7ccf32decb3b19987160af3494fb84ebcb 100755 (executable)
@@ -86,7 +86,7 @@ fi
 
 skip_if_no_datefudge
 #this was causing a double free; verify that we receive the expected error code
-gnutls_timewrapper_standalone static "2020-01-01 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2020-01-01 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --verify-chain --infile "${srcdir}/data/cve-2019-3829.pem"
 rc=$?
 
index 401b910d83c7c0839e60453b8f814d32d3d08d23..1e1286d3dc6ae4aaa2034a516ca05f1e20fd4783 100755 (executable)
@@ -44,7 +44,7 @@ fi
 # time set using faketime/datefudge could have changed since the generation
 # (if example the system was busy)
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-krb5name.tmpl" \
@@ -70,7 +70,7 @@ fi
 cp "${srcdir}/templates/template-krb5name.tmpl" ${TMPLFILE}
 echo "krb5_principal = 'xxxxxxxxxxxxxx'" >>${TMPLFILE}
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template ${TMPLFILE} \
@@ -87,7 +87,7 @@ fi
 cp "${srcdir}/templates/template-krb5name.tmpl" ${TMPLFILE}
 echo "krb5_principal = 'comp1/comp2/comp3/comp4/comp5/comp6/comp7/comp8/comp9/comp10@REALM.COM'" >>${TMPLFILE}
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template ${TMPLFILE} \
index c6f955a737917095fa6adf49f14a4e9f2b82fbb5..32462e92477a10388aa088579d2e37365032a2c5 100755 (executable)
@@ -37,7 +37,7 @@ skip_if_no_datefudge
 
 # Test MD5 signatures
 
-gnutls_timewrapper_standalone static "2016-04-15 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2016-04-15 00:00:00" \
        "${CERTTOOL}" --verify-chain --infile "${srcdir}/data/chain-md5.pem" >/dev/null 2>&1
 rc=$?
 if test "${rc}" != "1"; then
@@ -45,7 +45,7 @@ if test "${rc}" != "1"; then
        exit ${rc}
 fi
 
-gnutls_timewrapper_standalone static "2016-04-15 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2016-04-15 00:00:00" \
        "${CERTTOOL}" --verify-allow-broken --verify-chain --infile "${srcdir}/data/chain-md5.pem" >/dev/null 2>&1
 rc=$?
 if test "${rc}" != "0"; then
index 8cf002ecf438f8cd10f4e29a929a0433978533f8..aaa16aae8151a696ac02c2f359cddac6f0e7dcb2 100755 (executable)
@@ -37,7 +37,7 @@ TMPFILE=constraints.$$.pem.tmp
 
 skip_if_no_datefudge
 
-gnutls_timewrapper_standalone static "2016-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2016-04-22 00:00:00" \
        ${VALGRIND} "${CERTTOOL}" --verify-allow-broken -e --infile "${srcdir}/data/name-constraints-ip.pem"
 rc=$?
 
index e8780e77efe743aad74a3ce5f137bc7c10aed086..7d4a63f63ce481470183fb13f288eb0f1f64cae3 100755 (executable)
@@ -38,7 +38,7 @@ skip_if_no_datefudge
 # time set using faketime/datefudge could have changed since the generation
 # (if example the system was busy)
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-othername.tmpl" \
@@ -53,7 +53,7 @@ if test "${rc}" != "0"; then
        exit ${rc}
 fi
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-othername-xmpp.tmpl" \
index f7df8eaaef0c8f74341150fa8553704925b5786f..d2238aea1e7092ff37835015fe17aa6bb50ae9fa 100755 (executable)
@@ -42,8 +42,8 @@ TMPFILE2=pkcs1-pad-2.$$.tmp
 
 EXPECT1=2002
 
-gnutls_timewrapper_standalone "2006-09-23" "${CERTTOOL}" --verify-allow-broken --verify-chain --infile "${srcdir}/data/pkcs1-pad-ok.pem" | tee $TMPFILE1 >/dev/null 2>&1
-gnutls_timewrapper_standalone "2006-09-23" "${CERTTOOL}" --verify-allow-broken --verify-chain --infile "${srcdir}/data/pkcs1-pad-broken.pem" | tee $TMPFILE2 >/dev/null 2>&1
+"$FAKETIME" "2006-09-23" "${CERTTOOL}" --verify-allow-broken --verify-chain --infile "${srcdir}/data/pkcs1-pad-ok.pem" | tee $TMPFILE1 >/dev/null 2>&1
+"$FAKETIME" "2006-09-23" "${CERTTOOL}" --verify-allow-broken --verify-chain --infile "${srcdir}/data/pkcs1-pad-broken.pem" | tee $TMPFILE2 >/dev/null 2>&1
 
 out1oks=`grep 'Verified.' $TMPFILE1 | wc -l | tr -d " "`
 out2oks=`grep 'Verified.' $TMPFILE2 | wc -l | tr -d " "`
@@ -65,8 +65,8 @@ echo "PKCS1-PAD1 OK"
 
 EXPECT2=2002
 
-gnutls_timewrapper_standalone "2006-09-23" "${CERTTOOL}" --verify-chain --infile "${srcdir}/data/pkcs1-pad-ok2.pem" | tee $TMPFILE1 >/dev/null 2>&1
-gnutls_timewrapper_standalone "2006-09-23" "${CERTTOOL}" --verify-chain --infile "${srcdir}/data/pkcs1-pad-broken2.pem" | tee $TMPFILE2 >/dev/null 2>&1
+"$FAKETIME" "2006-09-23" "${CERTTOOL}" --verify-chain --infile "${srcdir}/data/pkcs1-pad-ok2.pem" | tee $TMPFILE1 >/dev/null 2>&1
+"$FAKETIME" "2006-09-23" "${CERTTOOL}" --verify-chain --infile "${srcdir}/data/pkcs1-pad-broken2.pem" | tee $TMPFILE2 >/dev/null 2>&1
 
 out1oks=`grep 'Verified.' $TMPFILE1 | wc -l | tr -d " "`
 out2oks=`grep 'Verified.' $TMPFILE2 | wc -l | tr -d " "`
@@ -88,7 +88,7 @@ echo "PKCS1-PAD2 OK"
 # by Andrei Pyshkin, Erik Tews and Ralf-Philipp Weinmann.
 
 
-gnutls_timewrapper_standalone "2006-09-23" "${CERTTOOL}" --verify-chain --infile "${srcdir}/data/pkcs1-pad-broken3.pem" | tee $TMPFILE1 >/dev/null 2>&1
+"$FAKETIME" "2006-09-23" "${CERTTOOL}" --verify-chain --infile "${srcdir}/data/pkcs1-pad-broken3.pem" | tee $TMPFILE1 >/dev/null 2>&1
 
 out1oks=`grep 'Verified.' $TMPFILE1 | wc -l | tr -d " "`
 out1fails=`grep 'Not verified.' $TMPFILE1 | wc -l | tr -d " "`
index 50f3bc5e7343495200dff23ec8a487d53a3bbc8d..3fed7b08b891000d8733f89fc1719acde126381d 100755 (executable)
@@ -36,7 +36,7 @@ OUTFILE=out-pkcs7.$$.tmp
 . ${srcdir}/../scripts/common.sh
 
 skip_if_no_datefudge
-gnutls_timewrapper_standalone static "2016-10-01 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2016-10-01 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --verify-allow-broken --p7-verify --inder --infile "${srcdir}/data/pkcs7-cat.p7" --load-ca-certificate "${srcdir}/data/pkcs7-cat-ca.pem" 
 rc=$?
 
index 7587c3a946cabe86c238fc07217bbc7717e3a728..91f018774a891938796e2e39a3b287ba66822667 100755 (executable)
@@ -51,7 +51,7 @@ fi
 FILE="signing-verify-no-purpose"
 echo ""
 echo "test: $FILE"
-gnutls_timewrapper_standalone static "2015-01-10 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2015-01-10 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --p7-verify --load-ca-certificate "${srcdir}/data/code-signing-ca.pem" <"${OUTFILE}"
 rc=$?
 
@@ -63,7 +63,7 @@ fi
 FILE="signing-verify-valid-purpose"
 echo ""
 echo "test: $FILE"
-gnutls_timewrapper_standalone static "2015-01-10 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2015-01-10 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --verify-purpose 1.3.6.1.5.5.7.3.3 --p7-verify --load-ca-certificate "${srcdir}/data/code-signing-ca.pem" <"${OUTFILE}"
 rc=$?
 
@@ -75,7 +75,7 @@ fi
 FILE="signing-verify-invalid-purpose"
 echo ""
 echo "test: $FILE"
-gnutls_timewrapper_standalone static "2015-01-10 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2015-01-10 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --verify-purpose 1.3.6.1.5.5.7.3.1 --p7-verify --load-ca-certificate "${srcdir}/data/code-signing-ca.pem" <"${OUTFILE}"
 rc=$?
 
@@ -87,7 +87,7 @@ fi
 FILE="signing-verify-invalid-date-1"
 echo ""
 echo "test: $FILE"
-gnutls_timewrapper_standalone static "2011-01-10 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2011-01-10 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --verify-purpose 1.3.6.1.5.5.7.3.3 --p7-verify --load-ca-certificate "${srcdir}/data/code-signing-ca.pem" <"${OUTFILE}"
 rc=$?
 
@@ -99,7 +99,7 @@ fi
 FILE="signing-verify-invalid-date-2"
 echo ""
 echo "test: $FILE"
-gnutls_timewrapper_standalone static "2018-01-10 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2018-01-10 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --verify-purpose 1.3.6.1.5.5.7.3.3 --p7-verify --load-ca-certificate "${srcdir}/data/code-signing-ca.pem" <"${OUTFILE}"
 rc=$?
 
index 609bcb7786b92bce0799f296ea0b452068841eec..5039a2c0c8cbce6b91c55370691a9532e01c6ec0 100755 (executable)
@@ -51,7 +51,7 @@ fi
 FILE="signing-verify-no-purpose"
 echo ""
 echo "test: $FILE"
-gnutls_timewrapper_standalone static "2015-01-10 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2015-01-10 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --p7-verify --load-certificate "${srcdir}/data/code-signing-cert.pem" <"${OUTFILE}"
 rc=$?
 
@@ -63,7 +63,7 @@ fi
 FILE="signing-verify-valid-purpose"
 echo ""
 echo "test: $FILE"
-gnutls_timewrapper_standalone static "2015-01-10 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2015-01-10 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --verify-purpose 1.3.6.1.5.5.7.3.3 --p7-verify --load-certificate "${srcdir}/data/code-signing-cert.pem" <"${OUTFILE}"
 rc=$?
 
@@ -75,7 +75,7 @@ fi
 FILE="signing-verify-invalid-purpose"
 echo ""
 echo "test: $FILE"
-gnutls_timewrapper_standalone static "2015-01-10 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2015-01-10 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --verify-purpose 1.3.6.1.5.5.7.3.1 --p7-verify --load-certificate "${srcdir}/data/code-signing-cert.pem" <"${OUTFILE}"
 rc=$?
 
@@ -87,7 +87,7 @@ fi
 FILE="signing-verify-invalid-date-1"
 echo ""
 echo "test: $FILE"
-gnutls_timewrapper_standalone static "2011-01-10 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2011-01-10 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --verify-purpose 1.3.6.1.5.5.7.3.3 --p7-verify --load-certificate "${srcdir}/data/code-signing-cert.pem" <"${OUTFILE}"
 rc=$?
 
@@ -99,7 +99,7 @@ fi
 FILE="signing-verify-invalid-date-2"
 echo ""
 echo "test: $FILE"
-gnutls_timewrapper_standalone static "2018-01-10 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2018-01-10 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --verify-purpose 1.3.6.1.5.5.7.3.3 --p7-verify --load-certificate "${srcdir}/data/code-signing-cert.pem" <"${OUTFILE}"
 rc=$?
 
index e1bf8745525757500242268e96833a7110f28cde..40fffb6eaf568f31234922bbe2a0ccd55df6f508 100755 (executable)
@@ -80,7 +80,7 @@ fi
 
 for FILE in full.p7b openssl.p7b openssl-keyid.p7b; do
 # check validation with date prior to CA issuance
-gnutls_timewrapper_standalone static "2011-01-10 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2011-01-10 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --inder --p7-verify --load-ca-certificate "${srcdir}/../../doc/credentials/x509/ca.pem" --infile "${srcdir}/data/${FILE}" >"${OUTFILE}"
 rc=$?
 
@@ -90,7 +90,7 @@ if test "${rc}" = "0"; then
 fi
 
 # check validation with date prior to intermediate cert issuance
-env TZ=UTC gnutls_timewrapper_standalone static "2011-05-28 08:38:00" \
+env TZ=UTC "$FAKETIME" "$FAKETIME_F_OPT" "2011-05-28 08:38:00" \
 ${VALGRIND} "${CERTTOOL}" --inder --p7-verify --load-ca-certificate "${srcdir}/../../doc/credentials/x509/ca.pem" --infile "${srcdir}/data/${FILE}" >"${OUTFILE}"
 rc=$?
 
@@ -100,7 +100,7 @@ if test "${rc}" = "0"; then
 fi
 
 # check validation with date after intermediate cert issuance
-gnutls_timewrapper_standalone static "2038-10-13 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2038-10-13 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --inder --p7-verify --load-ca-certificate "${srcdir}/../../doc/credentials/x509/ca.pem" --infile "${srcdir}/data/${FILE}" >"${OUTFILE}"
 rc=$?
 
index 298de392a3963f382f109d0444d301663cfb8873..adb107ef484e327343a848f72c11ef8eddf7b866 100755 (executable)
@@ -41,7 +41,7 @@ skip_if_no_datefudge
 # Test PSS signatures on certificate
 
 for i in sha256 sha384 sha512;do
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
 "${CERTTOOL}" --generate-self-signed --key-type rsa-pss \
                --load-privkey "${srcdir}/data/privkey1.pem" \
                --template "${srcdir}/templates/template-test.tmpl" \
@@ -59,7 +59,7 @@ if test "${rc}" != "0"; then
        exit ${rc}
 fi
 
-gnutls_timewrapper_standalone static "2007-04-25 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-25 00:00:00" \
        "${CERTTOOL}" --load-ca-certificate "${TMPFILE}" --verify --infile "${TMPFILE}" >/dev/null 2>&1
 rc=$?
 if test "${rc}" != "0"; then
index 6fd4b0307cd217d73dba8e7a8fb9f1e6838f992b..c2dbd963b87a84ab17575aba868ed3e38688d650 100755 (executable)
@@ -41,7 +41,7 @@ skip_if_no_datefudge
 # Test SHA3 signatures
 
 for i in sha3-224 sha3-256 sha3-384 sha3-512;do
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
 "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-test.tmpl" \
@@ -59,7 +59,7 @@ if test "${rc}" != "0"; then
        exit ${rc}
 fi
 
-gnutls_timewrapper_standalone static "2007-04-25 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-25 00:00:00" \
        "${CERTTOOL}" --load-ca-certificate "${TMPFILE}" --verify --infile "${TMPFILE}" >/dev/null 2>&1
 rc=$?
 if test "${rc}" != "0"; then
@@ -71,7 +71,7 @@ done
 # Test SHA3 signatures with ECDSA
 
 for i in sha3-224 sha3-256 sha3-384 sha3-512;do
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
 "${CERTTOOL}" --generate-self-signed \
        --load-privkey "${srcdir}/data/template-test-ecc.key" \
        --template "${srcdir}/templates/template-test.tmpl" \
@@ -83,7 +83,7 @@ if test "${rc}" != "0"; then
        exit ${rc}
 fi
 
-gnutls_timewrapper_standalone static "2007-04-25 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-25 00:00:00" \
        "${CERTTOOL}" --load-ca-certificate "${TMPFILE}" --verify --infile "${TMPFILE}" >/dev/null 2>&1
 rc=$?
 if test "${rc}" != "0"; then
index 5e3ab17c50c2535e4b6ba67a27c7fa6a7f835441..97db6618dcda9997f04251d67df4cae421fc6159 100755 (executable)
@@ -46,7 +46,7 @@ if test "${rc}" != "0"; then
 fi
 
 
-gnutls_timewrapper_standalone static "2017-04-06 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2017-04-06 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --p7-verify --load-certificate "${srcdir}/../../doc/credentials/x509/cert-rsa.pem" <"${OUTFILE}"
 rc=$?
 
index c3f99253a28da48da43b668549a4a4e7cf9bf147..bb31dadb9fb83eb3dda5654d8a979268f9126325 100755 (executable)
@@ -34,7 +34,7 @@ export TZ="UTC"
 
 skip_if_no_datefudge
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/arb-extensions.tmpl" \
@@ -52,7 +52,7 @@ fi
 rm -f "$OUTFILE"
 
 # Test adding critical extensions only
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/crit-extensions.tmpl" \
@@ -69,7 +69,7 @@ fi
 
 rm -f "$OUTFILE"
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-request \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/arb-extensions.tmpl" \
index e0eda056c7e951cd1b9063618a939195b7f61d3f..79f71cf5478ab1ad8232b5112a48bf0f32a905b6 100755 (executable)
@@ -34,7 +34,7 @@ export TZ="UTC"
 
 skip_if_no_datefudge
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/simple-policy.tmpl" \
index 1dda7aefd78bbb993f1b194383b49c1ed035d54f..17283b61dcae850c6087d90fd2b6793fee2265db 100755 (executable)
@@ -41,7 +41,7 @@ echo "Running test for ${ac_cv_sizeof_time_t}-byte time_t"
 # time set using faketime/datefudge could have changed since the generation
 # (if example the system was busy)
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-test.tmpl" \
@@ -58,7 +58,7 @@ fi
 
 rm -f ${TMPFILE}
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-utf8.tmpl" \
@@ -75,7 +75,7 @@ fi
 
 rm -f ${TMPFILE}
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-dn.tmpl" \
@@ -94,7 +94,7 @@ rm -f ${TMPFILE}
 
 echo "Running test for certificate generation with --generate-self-signed"
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-certificate \
                --load-privkey "${srcdir}/data/template-test.key" \
                --load-ca-privkey "${srcdir}/../../doc/credentials/x509/ca-key.pem" \
@@ -113,7 +113,7 @@ fi
 
 rm -f ${TMPFILE}
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-dn-err.tmpl" \
@@ -127,7 +127,7 @@ fi
 
 rm -f ${TMPFILE}
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-overflow.tmpl" \
@@ -146,7 +146,7 @@ rm -f ${TMPFILE}
 
 # The following test works in 64-bit systems
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-overflow2.tmpl" \
@@ -176,7 +176,7 @@ else
 fi
 rm -f ${TMPFILE}
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-date.tmpl" \
@@ -193,7 +193,7 @@ fi
 
 rm -f ${TMPFILE}
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-dates-after2038.tmpl" \
@@ -223,7 +223,7 @@ rm -f ${TMPFILE}
 
 # Test name constraints generation
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-nc.tmpl" \
@@ -244,7 +244,7 @@ rm -f ${TMPFILE}
 # Test the GeneralizedTime support
 if test "${ac_cv_sizeof_time_t}" = 8;then
        # we should test that on systems which have 64-bit time_t.
-       gnutls_timewrapper_standalone static "2051-04-22 00:00:00" \
+       "$FAKETIME" "$FAKETIME_F_OPT" "2051-04-22 00:00:00" \
                        "${CERTTOOL}" --generate-self-signed \
                                --load-privkey "${srcdir}/data/template-test.key" \
                                --template "${srcdir}/templates/template-generalized.tmpl" \
@@ -264,7 +264,7 @@ rm -f ${TMPFILE}
 
 # Test unique ID field generation
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-unique.tmpl" \
@@ -283,7 +283,7 @@ rm -f ${TMPFILE}
 
 # Test generation with very long dns names
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-long-dns.tmpl" \
@@ -302,7 +302,7 @@ rm -f ${TMPFILE}
 
 # Test generation with larger serial number
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
        "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-long-serial.tmpl" \
index 109a9de462a60819da37b04785290b85d8cd3a28..6c3c5a37c9eab77a537a83dbcee39dfbdcccccaa 100755 (executable)
@@ -38,7 +38,7 @@ skip_if_no_datefudge
 #
 # Test certificate generation
 #
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
 "${CERTTOOL}" --generate-self-signed \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-tlsfeature.tmpl" \
@@ -97,7 +97,7 @@ fi
 # Test certificate request generation
 #
 
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
 "${CERTTOOL}" --generate-request \
                --load-privkey "${srcdir}/data/template-test.key" \
                --template "${srcdir}/templates/template-tlsfeature.tmpl" \
@@ -158,7 +158,7 @@ fi
 #
 # Test certificate generation after a request
 #
-gnutls_timewrapper_standalone static "2007-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2007-04-22 00:00:00" \
 "${CERTTOOL}" --generate-certificate \
                --load-privkey "${srcdir}/data/template-test.key" \
                --load-ca-privkey "${srcdir}/data/template-test.key" \
index ccb244666b4b9efc18a2d063b428d2dcfc084457..e0ea2c0158480af4b813d0afc3f3ed36b31ef9a4 100755 (executable)
@@ -115,7 +115,7 @@ verify_certificate_test() {
        file=$2
 
        echo -n "* Verifying a certificate... "
-       gnutls_timewrapper_standalone static "2015-10-10 00:00:00" \
+       "$FAKETIME" "$FAKETIME_F_OPT" "2015-10-10 00:00:00" \
        $CERTTOOL ${ADDITIONAL_PARAM} --verify --load-ca-certificate "$url" --infile "$file" >>"${TMPFILE}" 2>&1
        if test $? = 0; then
                echo ok
diff --git a/tests/datefudge-check.c b/tests/datefudge-check.c
deleted file mode 100644 (file)
index c78a504..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2019 Red Hat
- *
- * Author: Daiki Ueno
- *
- * This file is part of GnuTLS.
- *
- * GnuTLS is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * GnuTLS is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program.  If not, see <https://www.gnu.org/licenses/>
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-
-int main(void)
-{
-       char outstr[200];
-       time_t t;
-       struct tm *tmp;
-
-       t = time(NULL);
-       tmp = localtime(&t);
-       if (tmp == NULL) {
-               perror("localtime");
-               exit(EXIT_FAILURE);
-       }
-
-       if (strftime(outstr, sizeof(outstr), "%s", tmp) == 0) {
-               fprintf(stderr, "strftime returned 0");
-               exit(EXIT_FAILURE);
-       }
-
-       puts(outstr);
-       exit(EXIT_SUCCESS);
-}
index d4b7700857279cf3d955f585a9c706005a60705f..1a32cde4c82557769899788172ac2c119a81e9a2 100755 (executable)
@@ -71,7 +71,7 @@ launch_server --echo --priority "NORMAL:-VERS-ALL:+VERS-TLS1.2:+VERS-TLS1.1" --x
 PID=$!
 wait_server ${PID}
 
-gnutls_timewrapper_standalone "2017-08-9" timeout 1800 \
+"$FAKETIME" "2017-08-9" timeout 1800 \
 "${DCLI}" -p "${PORT}" localhost >$OUTFILE 2>&1 || fail ${PID} "gnutls-cli-debug run should have succeeded!"
 
 kill ${PID}
@@ -118,7 +118,7 @@ launch_server --echo --priority "NORMAL:-VERS-ALL:+VERS-TLS1.3:+VERS-TLS1.2" --x
 PID=$!
 wait_server ${PID}
 
-gnutls_timewrapper_standalone "2017-08-9" timeout 1800 \
+"$FAKETIME" "2017-08-9" timeout 1800 \
 "${DCLI}" -p "${PORT}" localhost >$OUTFILE 2>&1 || fail ${PID} "gnutls-cli-debug run should have succeeded!"
 
 kill ${PID}
@@ -160,7 +160,7 @@ launch_server --echo --priority "NORMAL:-VERS-ALL:+VERS-TLS1.3:+VERS-TLS1.2:-RSA
 PID=$!
 wait_server ${PID}
 
-gnutls_timewrapper_standalone "2017-08-9" timeout 1800 \
+"$FAKETIME" "2017-08-9" timeout 1800 \
 "${DCLI}" -p "${PORT}" localhost >$OUTFILE 2>&1 || fail ${PID} "gnutls-cli-debug run should have succeeded!"
 
 kill ${PID}
@@ -186,7 +186,7 @@ tls-disabled-cipher = CAMELLIA-256-CBC
 _EOF_
 
 GNUTLS_SYSTEM_PRIORITY_FILE="${TMPFILE}" \
-gnutls_timewrapper_standalone "2017-08-9" timeout 1800 \
+"$FAKETIME" "2017-08-9" timeout 1800 \
 "${DCLI}" -p "${PORT}" localhost >$OUTFILE 2>&1 || fail ${PID} "gnutls-cli-debug run should have succeeded!"
 
 kill ${PID}
@@ -209,7 +209,7 @@ if test "${ENABLE_GOST}" = "1" && test "${GNUTLS_FORCE_FIPS_MODE}" != 1 ; then
        PID=$!
        wait_server ${PID}
 
-       gnutls_timewrapper_standalone "2017-08-9" timeout 1800 \
+       "$FAKETIME" "2017-08-9" timeout 1800 \
        "${DCLI}" -p "${PORT}" localhost >$OUTFILE 2>&1 || fail ${PID} "gnutls-cli-debug run should have succeeded!"
 
        kill ${PID}
index 5d421481394892194ded848070587e32623f32cf..574476d52f2f75a1b573d90945fe254e2a3a94ee 100755 (executable)
@@ -168,7 +168,7 @@ launch_server --echo --x509keyfile ${TMPFILE} --x509certfile ${TMPFILE}
 PID=$!
 wait_server ${PID}
 
-gnutls_timewrapper_standalone "2018-9-19" \
+"$FAKETIME" "2018-9-19" \
 ${VALGRIND} "${CLI}" -p "${PORT}" localhost --x509crlfile ${CRLFILE} --x509cafile ${CAFILE} >${TMPFILE} 2>&1 </dev/null && \
        fail ${PID} "1. handshake should have failed!"
 
index 30ba64e25e5616899ac124dae762facff9932266..297abb0a1c021403486b1fbac5ed2b4eaf196b5b 100755 (executable)
@@ -123,7 +123,7 @@ launch_server --echo --x509keyfile ${TMPFILE} --x509certfile ${TMPFILE}
 PID=$!
 wait_server ${PID}
 
-gnutls_timewrapper_standalone "2018-1-1" \
+"$FAKETIME" "2018-1-1" \
 ${VALGRIND} "${CLI}" -p "${PORT}" localhost >${TMPFILE} 2>&1 </dev/null && \
        fail ${PID} "1. handshake should have failed!"
 
index 96c26085a60902a7bc7d7e77dd5f595c23c80455..c1c26c29cb517788752210bef83526ecfbaee970 100755 (executable)
@@ -33,7 +33,7 @@ export TZ="UTC"
 
 skip_if_no_datefudge
 
-gnutls_timewrapper_standalone static "2017-06-19 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2017-06-19 00:00:00" \
        "${OCSPTOOL}" -e --load-chain "${srcdir}/ocsp-tests/certs/chain-amazon.com.pem" --infile "${srcdir}/ocsp-tests/certs/ocsp-amazon.com.der" --verify-allow-broken
 rc=$?
 
@@ -43,7 +43,7 @@ if test "${rc}" != "0"; then
        exit ${rc}
 fi
 
-gnutls_timewrapper_standalone static "2017-06-19 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2017-06-19 00:00:00" \
        "${OCSPTOOL}" -e --load-chain "${srcdir}/ocsp-tests/certs/chain-amazon.com-unsorted.pem" --infile "${srcdir}/ocsp-tests/certs/ocsp-amazon.com.der" --verify-allow-broken
 rc=$?
 
@@ -54,7 +54,7 @@ if test "${rc}" != "0"; then
 fi
 
 # verify an OCSP response using ECDSA
-gnutls_timewrapper_standalone static "2017-06-29 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2017-06-29 00:00:00" \
        "${OCSPTOOL}" -d 6 -e --load-chain "${srcdir}/ocsp-tests/certs/chain-akamai.com.pem" --infile "${srcdir}/ocsp-tests/certs/ocsp-akamai.com.der"
 rc=$?
 
index 29c115878528c364f5530bb499da2fd899974b4e..79f181337cf5b05f735d172b6ddb48c5343f44a3 100755 (executable)
@@ -100,7 +100,7 @@ chmod u+w "$TEMPLATE_FILE"
 echo "ocsp_uri=http://localhost:${OCSP_PORT}/ocsp/" >>"$TEMPLATE_FILE"
 
 # Generate certificates with the random port
-gnutls_timewrapper_standalone static "${CERTDATE}" ${CERTTOOL} \
+"$FAKETIME" "$FAKETIME_F_OPT" "${CERTDATE}" ${CERTTOOL} \
        --generate-certificate --load-ca-privkey "${srcdir}/ocsp-tests/certs/ca.key" \
        --load-ca-certificate "${srcdir}/ocsp-tests/certs/ca.pem" \
        --load-privkey "${srcdir}/ocsp-tests/certs/server_good.key" \
@@ -109,7 +109,7 @@ gnutls_timewrapper_standalone static "${CERTDATE}" ${CERTTOOL} \
 # Generate certificates with the random port (with mandatory stapling extension)
 echo "tls_feature = 5" >>"$TEMPLATE_FILE"
 
-gnutls_timewrapper_standalone static "${CERTDATE}" ${CERTTOOL} \
+"$FAKETIME" "$FAKETIME_F_OPT" "${CERTDATE}" ${CERTTOOL} \
        --generate-certificate --load-ca-privkey "${srcdir}/ocsp-tests/certs/ca.key" \
        --load-ca-certificate "${srcdir}/ocsp-tests/certs/ca.pem" \
        --load-privkey "${srcdir}/ocsp-tests/certs/server_good.key" \
@@ -129,7 +129,7 @@ cp "${srcdir}/ocsp-tests/certs/ocsp_index.txt.attr" ${ATTRFILE}
 # SO_REUSEADDR usage.
 PORT=${OCSP_PORT}
 launch_bare_server \
-         gnutls_timewrapper_standalone "${TESTDATE}" \
+         "$FAKETIME" "${TESTDATE}" \
          "${OPENSSL}" ocsp -index "${INDEXFILE}" -text \
          -port "${OCSP_PORT}" \
          -rsigner "${srcdir}/ocsp-tests/certs/ocsp-server.pem" \
@@ -145,7 +145,7 @@ echo "=== Verifying OCSP server is up ==="
 t=0
 while test "${t}" -lt "${SERVER_START_TIMEOUT}"; do
     # Run a test request to make sure the server works
-    gnutls_timewrapper_standalone "${TESTDATE}" \
+    "$FAKETIME" "${TESTDATE}" \
              ${VALGRIND} "${OCSPTOOL}" --ask \
              --load-cert "${SERVER_CERT_FILE}" \
              --load-issuer "${srcdir}/ocsp-tests/certs/ca.pem" \
@@ -170,7 +170,7 @@ echo "=== Test 1: Server with valid certificate - no staple ==="
 
 PORT=${TLS_SERVER_PORT}
 launch_bare_server \
-         gnutls_timewrapper_standalone "${TESTDATE}" \
+         "$FAKETIME" "${TESTDATE}" \
          "${SERV}" --echo --disable-client-cert \
          --x509keyfile="${srcdir}/ocsp-tests/certs/server_good.key" \
          --x509certfile="${SERVER_CERT_FILE}" \
@@ -181,7 +181,7 @@ wait_server $TLS_SERVER_PID
 wait_for_port "${TLS_SERVER_PORT}"
 
 echo "test 123456" | \
-    gnutls_timewrapper_standalone static "${TESTDATE}" \
+    "$FAKETIME" "$FAKETIME_F_OPT" "${TESTDATE}" \
              "${CLI}" --ocsp --x509cafile="${srcdir}/ocsp-tests/certs/ca.pem" \
              --port="${TLS_SERVER_PORT}" localhost
 rc=$?
@@ -202,7 +202,7 @@ eval "${GETPORT}"
 TLS_SERVER_PORT=$PORT
 PORT=${TLS_SERVER_PORT}
 launch_bare_server \
-         gnutls_timewrapper_standalone "${TESTDATE}" \
+         "$FAKETIME" "${TESTDATE}" \
          "${SERV}" --echo --disable-client-cert \
          --x509keyfile="${srcdir}/ocsp-tests/certs/server_good.key" \
          --x509certfile="${SERVER_CERT_FILE}" \
@@ -214,7 +214,7 @@ wait_server $TLS_SERVER_PID
 wait_for_port "${TLS_SERVER_PORT}"
 
 echo "test 123456" | \
-    gnutls_timewrapper_standalone static "${TESTDATE}" \
+    "$FAKETIME" "$FAKETIME_F_OPT" "${TESTDATE}" \
              "${CLI}" --ocsp --x509cafile="${srcdir}/ocsp-tests/certs/ca.pem" \
              --port="${TLS_SERVER_PORT}" localhost
 rc=$?
@@ -237,7 +237,7 @@ eval "${GETPORT}"
 TLS_SERVER_PORT=$PORT
 PORT=${TLS_SERVER_PORT}
 launch_bare_server \
-         gnutls_timewrapper_standalone "${TESTDATE}" \
+         "$FAKETIME" "${TESTDATE}" \
          "${SERV}" --echo --disable-client-cert \
          --x509keyfile="${srcdir}/ocsp-tests/certs/server_good.key" \
          --x509certfile="${SERVER_CERT_FILE}" \
@@ -249,7 +249,7 @@ wait_server $TLS_SERVER_PID
 wait_for_port "${TLS_SERVER_PORT}"
 
 echo "test 123456" | \
-    gnutls_timewrapper_standalone static "${TESTDATE}" \
+    "$FAKETIME" "$FAKETIME_F_OPT" "${TESTDATE}" \
              "${CLI}" --ocsp --x509cafile="${srcdir}/ocsp-tests/certs/ca.pem" \
              --port="${TLS_SERVER_PORT}" localhost
 rc=$?
@@ -273,7 +273,7 @@ eval "${GETPORT}"
 TLS_SERVER_PORT=$PORT
 PORT=${TLS_SERVER_PORT}
 launch_bare_server \
-         gnutls_timewrapper_standalone "${TESTDATE}" \
+         "$FAKETIME" "${TESTDATE}" \
          "${SERV}" --echo --disable-client-cert \
          --x509keyfile="${srcdir}/ocsp-tests/certs/server_good.key" \
          --x509certfile="${SERVER_CERT_FILE}" \
@@ -285,7 +285,7 @@ wait_server $TLS_SERVER_PID
 wait_for_port "${TLS_SERVER_PORT}"
 
 echo "test 123456" | \
-    gnutls_timewrapper_standalone static "${TESTDATE}" \
+    "$FAKETIME" "$FAKETIME_F_OPT" "${TESTDATE}" \
              "${CLI}" --ocsp --x509cafile="${srcdir}/ocsp-tests/certs/ca.pem" \
              --port="${TLS_SERVER_PORT}" localhost
 rc=$?
@@ -307,7 +307,7 @@ rm -f "${OCSP_RESPONSE_FILE}"
 # Generate an OCSP response which expires in 2 days and use it after
 # a month. gnutls server doesn't send such a staple to clients.
 ${VALGRIND} ${OCSPTOOL} --generate-request --load-issuer "${srcdir}/ocsp-tests/certs/ocsp-server.pem" --load-cert "${SERVER_CERT_FILE}" --outfile "${OCSP_REQ_FILE}"
-gnutls_timewrapper_standalone static "${EXP_OCSP_DATE}" \
+"$FAKETIME" "$FAKETIME_F_OPT" "${EXP_OCSP_DATE}" \
        ${OPENSSL} ocsp -index "${INDEXFILE}" -rsigner "${srcdir}/ocsp-tests/certs/ocsp-server.pem" -rkey "${srcdir}/ocsp-tests/certs/ocsp-server.key" -CA "${srcdir}/ocsp-tests/certs/ca.pem" -reqin "${OCSP_REQ_FILE}" -respout "${OCSP_RESPONSE_FILE}" -ndays 2
 
 eval "${GETPORT}"
@@ -331,7 +331,7 @@ fi
 echo "=== Test 5.1: Server with valid certificate - expired staple (ignoring errors) ==="
 
 launch_bare_server \
-         gnutls_timewrapper_standalone "${TESTDATE}" \
+         "$FAKETIME" "${TESTDATE}" \
          "${SERV}" --echo --disable-client-cert \
          --x509keyfile="${srcdir}/ocsp-tests/certs/server_good.key" \
          --x509certfile="${SERVER_CERT_FILE}" \
@@ -344,7 +344,7 @@ wait_server $TLS_SERVER_PID
 wait_for_port "${TLS_SERVER_PORT}"
 
 echo "test 123456" | \
-    gnutls_timewrapper_standalone static "${TESTDATE}" \
+    "$FAKETIME" "$FAKETIME_F_OPT" "${TESTDATE}" \
              "${CLI}" --ocsp --x509cafile="${srcdir}/ocsp-tests/certs/ca.pem" \
              --port="${TLS_SERVER_PORT}" localhost
 rc=$?
@@ -367,7 +367,7 @@ echo "=== Test 6: Server with valid certificate - old staple ==="
 rm -f "${OCSP_RESPONSE_FILE}"
 
 ${VALGRIND} ${OCSPTOOL} --generate-request --load-issuer "${srcdir}/ocsp-tests/certs/ocsp-server.pem" --load-cert "${SERVER_CERT_FILE}" --outfile "${OCSP_REQ_FILE}"
-gnutls_timewrapper_standalone static "${EXP_OCSP_DATE}" \
+"$FAKETIME" "$FAKETIME_F_OPT" "${EXP_OCSP_DATE}" \
        ${OPENSSL} ocsp -index ${INDEXFILE} -rsigner "${srcdir}/ocsp-tests/certs/ocsp-server.pem" -rkey "${srcdir}/ocsp-tests/certs/ocsp-server.key" -CA "${srcdir}/ocsp-tests/certs/ca.pem" -reqin "${OCSP_REQ_FILE}" -respout "${OCSP_RESPONSE_FILE}"
 
 eval "${GETPORT}"
@@ -375,7 +375,7 @@ eval "${GETPORT}"
 TLS_SERVER_PORT=$PORT
 PORT=${TLS_SERVER_PORT}
 launch_bare_server \
-         gnutls_timewrapper_standalone "${TESTDATE}" \
+         "$FAKETIME" "${TESTDATE}" \
          "${SERV}" --echo --disable-client-cert \
          --x509keyfile="${srcdir}/ocsp-tests/certs/server_good.key" \
          --x509certfile="${SERVER_CERT_FILE}" \
@@ -387,7 +387,7 @@ wait_server $TLS_SERVER_PID
 wait_for_port "${TLS_SERVER_PORT}"
 
 echo "test 123456" | \
-    gnutls_timewrapper_standalone static "${TESTDATE}" \
+    "$FAKETIME" "$FAKETIME_F_OPT" "${TESTDATE}" \
              "${CLI}" --ocsp --x509cafile="${srcdir}/ocsp-tests/certs/ca.pem" \
              --port="${TLS_SERVER_PORT}" localhost
 rc=$?
@@ -410,7 +410,7 @@ if test "${GNUTLS_FORCE_FIPS_MODE}" != 1; then
     TLS_SERVER_PORT=$PORT
     PORT=${TLS_SERVER_PORT}
     launch_bare_server \
-       gnutls_timewrapper_standalone "${TESTDATE}" \
+       "$FAKETIME" "${TESTDATE}" \
        "${SERV}" --echo --disable-client-cert \
        --x509keyfile="${srcdir}/ocsp-tests/certs/server_good.key" \
        --x509certfile="${SERVER_CERT_FILE}" \
@@ -422,7 +422,7 @@ if test "${GNUTLS_FORCE_FIPS_MODE}" != 1; then
     wait_for_port "${TLS_SERVER_PORT}"
 
     echo "test 123456" | \
-       gnutls_timewrapper_standalone static "${TESTDATE}" \
+       "$FAKETIME" "$FAKETIME_F_OPT" "${TESTDATE}" \
                  "${CLI}" --priority "NORMAL:%NO_EXTENSIONS" --ocsp --x509cafile="${srcdir}/ocsp-tests/certs/ca.pem" \
                  --port="${TLS_SERVER_PORT}" localhost
     rc=$?
@@ -445,7 +445,7 @@ eval "${GETPORT}"
 TLS_SERVER_PORT=$PORT
 PORT=${TLS_SERVER_PORT}
 launch_bare_server \
-         gnutls_timewrapper_standalone "${TESTDATE}" \
+         "$FAKETIME" "${TESTDATE}" \
          "${SERV}" --echo --disable-client-cert \
          --x509keyfile="${srcdir}/ocsp-tests/certs/server_good.key" \
          --x509certfile="${SERVER_CERT_NO_EXT_FILE}" \
@@ -457,7 +457,7 @@ wait_server $TLS_SERVER_PID
 wait_for_port "${TLS_SERVER_PORT}"
 
 echo "test 123456" | \
-    gnutls_timewrapper_standalone static "${TESTDATE}" \
+    "$FAKETIME" "$FAKETIME_F_OPT" "${TESTDATE}" \
              "${CLI}" --ocsp --x509cafile="${srcdir}/ocsp-tests/certs/ca.pem" \
              --port="${TLS_SERVER_PORT}" localhost
 rc=$?
@@ -478,7 +478,7 @@ eval "${GETPORT}"
 TLS_SERVER_PORT=$PORT
 PORT=${TLS_SERVER_PORT}
 launch_bare_server \
-         gnutls_timewrapper_standalone "${TESTDATE}" \
+         "$FAKETIME" "${TESTDATE}" \
          "${SERV}" --echo --disable-client-cert \
          --x509keyfile="${srcdir}/ocsp-tests/certs/server_good.key" \
          --x509certfile="${SERVER_CERT_FILE}" \
@@ -490,7 +490,7 @@ wait_server $TLS_SERVER_PID
 wait_for_port "${TLS_SERVER_PORT}"
 
 echo "test 123456" | \
-    gnutls_timewrapper_standalone static "${TESTDATE}" \
+    "$FAKETIME" "$FAKETIME_F_OPT" "${TESTDATE}" \
              "${CLI}" --ocsp --x509cafile="${srcdir}/ocsp-tests/certs/ca.pem" \
              --port="${TLS_SERVER_PORT}" localhost
 rc=$?
index 4d58f87469adee2ee3c1dc3182bff6d0749d5e20..ded2ca35c9498194868ef2b3a65bfb07906721dd 100755 (executable)
@@ -38,7 +38,7 @@ trusted="${sample_dir}/trust.pem"
 verify_response ()
 {
     echo "verifying ${sample_dir}/${1} using ${trusted}"
-    gnutls_timewrapper_standalone static "${date}" \
+    "$FAKETIME" "$FAKETIME_F_OPT" "${date}" \
               "${OCSPTOOL}" --infile="${sample_dir}/${1}" \
               --verify-response --load-trust="${trusted}"
     return $?
index 127bcb3afbe3a24ee3bb68fcc32e0b7fa303525e..67388ebe8774df1bcf717201fed5746d6e3d9f2f 100755 (executable)
@@ -37,7 +37,7 @@ skip_if_no_datefudge
 # time set using faketime/datefudge could have changed since the generation
 # (if example the system was busy)
 
-gnutls_timewrapper_standalone static "2016-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2016-04-22 00:00:00" \
        "${OCSPTOOL}" -e --load-signer "${srcdir}/ocsp-tests/certs/ca.pem" --infile "${srcdir}/ocsp-tests/response1.der"
 rc=$?
 
@@ -47,7 +47,7 @@ if test "${rc}" != "0"; then
        exit ${rc}
 fi
 
-gnutls_timewrapper_standalone static "2016-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2016-04-22 00:00:00" \
        "${OCSPTOOL}" -e --load-signer "${srcdir}/ocsp-tests/certs/ocsp-server.pem" --infile "${srcdir}/ocsp-tests/response2.der"
 rc=$?
 
@@ -57,7 +57,7 @@ if test "${rc}" != "0"; then
        exit ${rc}
 fi
 
-gnutls_timewrapper_standalone static "2016-04-22 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2016-04-22 00:00:00" \
        "${OCSPTOOL}" -e --load-signer "${srcdir}/ocsp-tests/certs/ca.pem" --infile "${srcdir}/ocsp-tests/response2.der" -d 4
 rc=$?
 
index e59c25f60c0d0b3db52d650abe8db6816c2b83e1..0fefabcd966312d2c8ff2f8b6e927272c96409f6 100755 (executable)
@@ -96,7 +96,7 @@ chmod u+w "$TEMPLATE_FILE"
 echo "ocsp_uri=http://localhost:${OCSP_PORT}/ocsp/" >>"$TEMPLATE_FILE"
 
 # Generate certificates with the random port
-gnutls_timewrapper_standalone static "${CERTDATE}" ${CERTTOOL} \
+"$FAKETIME" "$FAKETIME_F_OPT" "${CERTDATE}" ${CERTTOOL} \
        --generate-certificate --load-ca-privkey "${srcdir}/ocsp-tests/certs/ca.key" \
        --load-ca-certificate "${srcdir}/ocsp-tests/certs/ca.pem" \
        --load-privkey "${srcdir}/ocsp-tests/certs/server_good.key" \
@@ -111,7 +111,7 @@ echo "=== Bringing OCSP server up ==="
 # SO_REUSEADDR usage.
 PORT=${OCSP_PORT}
 launch_bare_server \
-         gnutls_timewrapper_standalone "${TESTDATE}" \
+         "$FAKETIME" "${TESTDATE}" \
          "${OPENSSL}" ocsp -index "${srcdir}/ocsp-tests/certs/ocsp_index.txt" -text \
          -port "${OCSP_PORT}" \
          -rsigner "${srcdir}/ocsp-tests/certs/ocsp-server.pem" \
@@ -127,7 +127,7 @@ echo "=== Verifying OCSP server is up ==="
 t=0
 while test "${t}" -lt "${SERVER_START_TIMEOUT}"; do
     # Run a test request to make sure the server works
-    gnutls_timewrapper_standalone "${TESTDATE}" \
+    "$FAKETIME" "${TESTDATE}" \
              ${VALGRIND} "${OCSPTOOL}" --ask \
              --load-cert "${SERVER_CERT_FILE}" \
              --load-issuer "${srcdir}/ocsp-tests/certs/ca.pem"
@@ -149,7 +149,7 @@ echo "=== Test 1: Server with valid certificate ==="
 
 PORT=${TLS_SERVER_PORT}
 launch_bare_server \
-         gnutls_timewrapper_standalone "${TESTDATE}" \
+         "$FAKETIME" "${TESTDATE}" \
          "${SERV}" --echo --disable-client-cert \
          --x509keyfile="${srcdir}/ocsp-tests/certs/server_good.key" \
          --x509certfile="${SERVER_CERT_FILE}" \
@@ -160,7 +160,7 @@ wait_server $TLS_SERVER_PID
 wait_for_port "${TLS_SERVER_PORT}"
 
 echo "test 123456" | \
-    gnutls_timewrapper_standalone static "${TESTDATE}" \
+    "$FAKETIME" "$FAKETIME_F_OPT" "${TESTDATE}" \
              "${CLI}" --ocsp --x509cafile="${srcdir}/ocsp-tests/certs/ca.pem" \
              --port="${TLS_SERVER_PORT}" localhost
 rc=$?
@@ -182,7 +182,7 @@ cp "${srcdir}/ocsp-tests/certs/server_bad.template" "$TEMPLATE_FILE"
 echo "ocsp_uri=http://localhost:${OCSP_PORT}/ocsp/" >>"$TEMPLATE_FILE"
 
 # Generate certificates with the random port
-gnutls_timewrapper_standalone static "${CERTDATE}" ${CERTTOOL} \
+"$FAKETIME" "$FAKETIME_F_OPT" "${CERTDATE}" ${CERTTOOL} \
        --generate-certificate --load-ca-privkey "${srcdir}/ocsp-tests/certs/ca.key" \
        --load-ca-certificate "${srcdir}/ocsp-tests/certs/ca.pem" \
        --load-privkey "${srcdir}/ocsp-tests/certs/server_bad.key" \
@@ -194,7 +194,7 @@ eval "${GETPORT}"
 TLS_SERVER_PORT=$PORT
 
 launch_bare_server \
-         gnutls_timewrapper_standalone "${TESTDATE}" \
+         "$FAKETIME" "${TESTDATE}" \
          "${SERV}" --echo --disable-client-cert \
          --x509keyfile="${srcdir}/ocsp-tests/certs/server_bad.key" \
          --x509certfile="${SERVER_CERT_FILE}" \
@@ -204,7 +204,7 @@ wait_server ${TLS_SERVER_PID}
 wait_for_port "${TLS_SERVER_PORT}"
 
 echo "test 123456" | \
-    gnutls_timewrapper_standalone static "${TESTDATE}" \
+    "$FAKETIME" "$FAKETIME_F_OPT" "${TESTDATE}" \
              "${CLI}" --ocsp --x509cafile="${srcdir}/ocsp-tests/certs/ca.pem" \
              --port="${TLS_SERVER_PORT}" localhost
 rc=$?
index 12929868eaf071591b62579eecc05c905132bdac..c87804615ced6766bba4530508d86154c0a0b05d 100755 (executable)
@@ -36,7 +36,7 @@ fi
 skip_if_no_datefudge
 
 #try verification
-gnutls_timewrapper_standalone static "2010-10-10 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2010-10-10 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --verify-allow-broken --inder --p7-verify --infile "${srcdir}/data/test1.cat" --load-certificate "${srcdir}/data/pkcs7-cat-ca.pem"
 rc=$?
 
@@ -45,7 +45,7 @@ if test "${rc}" = "0"; then
        exit 1
 fi
 
-gnutls_timewrapper_standalone static "2016-10-10 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2016-10-10 00:00:00" \
 ${VALGRIND} "${CERTTOOL}" --verify-allow-broken --inder --p7-verify --infile "${srcdir}/data/test1.cat" --load-certificate "${srcdir}/data/pkcs7-cat-ca.pem"
 rc=$?
 
index cbd456560915d8f49cde2ed684cf67c221cf1a77..0feb34d0608cf660cc7c67ca5a3a3397e6d0a74e 100755 (executable)
@@ -36,7 +36,7 @@ skip_if_no_datefudge
 ASAN_OPTIONS="detect_leaks=0"
 export ASAN_OPTIONS
 
-gnutls_timewrapper_standalone static "2006-10-01 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2006-10-01 00:00:00" \
 "${CERTTOOL}" --verify-chain --outfile "$TMPFILE1" --infile "${srcdir}/rsa-md5-collision/colliding-chain-md5-1.pem"
 if test $? = 0;then
        echo "Verification on chain1 succeeded"
@@ -50,7 +50,7 @@ if test $? != 0;then
 fi
 
 
-gnutls_timewrapper_standalone static "2006-10-01 00:00:00" \
+"$FAKETIME" "$FAKETIME_F_OPT" "2006-10-01 00:00:00" \
 "${CERTTOOL}" --verify-chain --outfile "$TMPFILE2" --infile "${srcdir}/rsa-md5-collision/colliding-chain-md5-2.pem"
 if test $? = 0;then
        echo "Verification on chain2 succeeded"
index d2071ec41101ed922bc4b19ef3ddd2b00d53b854..cf943d7817e058e3f8118f1a5d47281aa374d8d1 100644 (file)
@@ -96,54 +96,11 @@ GETPORT='
 '
 
 skip_if_no_datefudge() {
-       # Prefer faketime, fall back to datefudge.
-       # Allow datefudge/faketime to be manually selected by setting env-var
-       if test -z "${GNUTLS_TIMEWRAPPER_CMD}" ; then
-               if test "$WINDOWS" = 1; then
-                       exit 77
-               fi
-
-               TSTAMP=`faketime -f "2006-09-23 00:00:00" "${top_builddir}/tests/datefudge-check" || true`
-               if test "$TSTAMP" = "1158969600"; then
-                       GNUTLS_TIMEWRAPPER_CMD=faketime
-               else
-                       TSTAMP=`datefudge -s "2006-09-23 00:00:00" "${top_builddir}/tests/datefudge-check" || true`
-                       if test "$TSTAMP" = "1158969600"; then
-                               GNUTLS_TIMEWRAPPER_CMD=datefudge
-                       else
-                               echo "You need faketime/datefudge to run this test"
-                               exit 77
-                       fi
-               fi
+       if test "$ac_cv_faketime_works" != yes; then
+               exit 77
        fi
 }
 
-gnutls_timewrapper_standalone() {
-       if test -z "${GNUTLS_TIMEWRAPPER_CMD}" ; then
-               echo "Missing invocation of skip_if_no_datefudge()"
-               exit 1
-       fi
-
-       if [ "$1" = "static" ] ; then
-               shift
-               case  ${GNUTLS_TIMEWRAPPER_CMD} in
-                       faketime)
-                               faketime -f "$@"
-                               ;;
-                       datefudge)
-                               datefudge -s "$@"
-                               ;;
-                       *)
-                               echo "GNUTLS_TIMEWRAPPER_CMD ${GNUTLS_TIMEWRAPPER_CMD} invalid" 1>&2
-                               exit 1
-                               ;;
-               esac
-       else
-               ${GNUTLS_TIMEWRAPPER_CMD} "$@"
-       fi
-}
-
-
 fail() {
    PID="$1"
    shift
index 43b2cf360a47bf36307b31c5a79e12b57a657056..6b6015ff200840e2a280c4ff247f58ea6a174c1f 100755 (executable)
@@ -64,15 +64,15 @@ launch_server --echo --priority "NORMAL:+ECDHE-RSA:+ECDHE-ECDSA" --x509keyfile $
 PID=$!
 wait_server ${PID}
 
-gnutls_timewrapper_standalone "2017-08-9" timeout 1800 \
+"$FAKETIME" "2017-08-9" timeout 1800 \
 "${CLI}" -p "${PORT}" localhost --x509cafile ${CAFILE} --priority "NORMAL:-KX-ALL:+ECDHE-RSA" </dev/null || \
        fail ${PID} "1. handshake with RSA should have succeeded!"
 
-gnutls_timewrapper_standalone "2017-08-9" timeout 1800 \
+"$FAKETIME" "2017-08-9" timeout 1800 \
 "${CLI}" -p "${PORT}" localhost --x509cafile ${CAFILE} --priority "NORMAL:-KX-ALL:+ECDHE-ECDSA" </dev/null || \
        fail ${PID} "2. handshake with ECC should have succeeded!"
 
-gnutls_timewrapper_standalone "2017-08-9" timeout 1800 \
+"$FAKETIME" "2017-08-9" timeout 1800 \
 "${CLI}" -p "${PORT}" localhost --x509cafile ${CAFILE} --priority "NORMAL:-VERS-ALL:+VERS-TLS1.2:-KX-ALL:+ECDHE-RSA:-SIGN-ALL:+SIGN-RSA-SHA256" --save-cert ${TMPFILE} </dev/null || \
        fail ${PID} "3. handshake with RSA should have succeeded!"
 
@@ -81,13 +81,13 @@ if test $? != 0;then
        fail ${PID} "3. the certificate used by server was not the expected"
 fi
 
-gnutls_timewrapper_standalone "2017-08-9" timeout 1800 \
+"$FAKETIME" "2017-08-9" timeout 1800 \
 "${CLI}" -p "${PORT}" localhost --x509cafile ${CAFILE} --priority "NORMAL:-KX-ALL:+ECDHE-RSA:+SIGN-RSA-SHA256:+SIGN-RSA-PSS-RSAE-SHA256" --save-cert ${TMPFILE} </dev/null || \
        fail ${PID} "4. handshake with RSA should have succeeded!"
 
 
 # check whether the server used the RSA-PSS certificate when we asked for RSA-PSS signature
-gnutls_timewrapper_standalone "2017-08-9" timeout 1800 \
+"$FAKETIME" "2017-08-9" timeout 1800 \
 "${CLI}" -p "${PORT}" localhost --x509cafile ${CAFILE} --priority "NORMAL:-KX-ALL:+ECDHE-RSA:-SIGN-ALL:+SIGN-RSA-PSS-SHA256" --save-cert ${TMPFILE} </dev/null || \
        fail ${PID} "4. handshake with RSA-PSS and SHA256 should have succeeded!"
 
index 2eef393eb7b7092b5e7c49b8a1231375e33ae5a6..2fa0d91852d9b258202f2e142c018990352d0ae4 100755 (executable)
@@ -57,11 +57,11 @@ launch_server --echo --priority "NORMAL" --x509keyfile ${KEY1} --x509certfile ${
 PID=$!
 wait_server ${PID}
 
-gnutls_timewrapper_standalone "2019-12-20" timeout 1800 \
+"$FAKETIME" "2019-12-20" timeout 1800 \
 "${CLI}" -d 4 -p "${PORT}" localhost --x509cafile ${CERT1} --priority NORMAL:-VERS-TLS-ALL:+VERS-TLS1.2 </dev/null && \
        fail ${PID} "1. handshake with RSA should have failed!"
 
-gnutls_timewrapper_standalone "2019-12-20" timeout 1800 \
+"$FAKETIME" "2019-12-20" timeout 1800 \
 "${CLI}" -d 4 -p "${PORT}" localhost --x509cafile ${CERT1} --priority NORMAL </dev/null && \
        fail ${PID} "2. handshake with RSA should have failed!"
 
index 44252a2ac724d6659eb0b30a94442d2264bb271d..3def64b77cc9b8e5614334ddd1e9ec8ed6b7926a 100644 (file)
@@ -80,6 +80,11 @@ scripts_to_test += tls-fuzzer/tls-fuzzer-nocert-ssl3.sh
 TESTS_ENVIRONMENT += ENABLE_SSL3=1
 endif
 
+TESTS_ENVIRONMENT +=                                   \
+       FAKETIME="$(FAKETIME)"                          \
+       FAKETIME_F_OPT="$(FAKETIME_F_OPT)"              \
+       ac_cv_faketime_works="$(ac_cv_faketime_works)"
+
 if ENABLE_TLS13_INTEROP
 scripts_to_test += \
        testcompat-openssl-tls13-cli.sh \
index 4c42a58110c5a73a94d6f1ecabd82de10610e5e4..bf2ace33fce333109073f92f3c1e7d4ed1ea2097 100755 (executable)
@@ -56,7 +56,7 @@ export TZ="UTC"
 
 skip_if_no_datefudge
 
-gnutls_timewrapper_standalone "2012-09-02" timeout 1800 \
+"$FAKETIME" "2012-09-02" timeout 1800 \
 "${srcdir}/testcompat-openssl-cli-common.sh" ":%COMPAT"
 
 ret=$?
index 78bb2b4eb1f72675a98589f3706909e2ba3962b6..c246b0e3fe79a33936f1c9fdc77be331c2dd32e7 100755 (executable)
@@ -56,7 +56,7 @@ export TZ="UTC"
 
 skip_if_no_datefudge
 
-gnutls_timewrapper_standalone "2012-09-02" timeout 1800 \
+"$FAKETIME" "2012-09-02" timeout 1800 \
 "${srcdir}/testcompat-openssl-cli-common.sh" ":%NO_ETM"
 
 ret=$?
index d0c6324adacf5194d39c45938a49e77f6f87ee95..4ba4acfbebf872a41c9781b4062dfa83ba3a4d31 100755 (executable)
@@ -56,7 +56,7 @@ export TZ="UTC"
 
 skip_if_no_datefudge
 
-gnutls_timewrapper_standalone "2012-09-02" timeout 1800 \
+"$FAKETIME" "2012-09-02" timeout 1800 \
 "${srcdir}/testcompat-openssl-cli-common.sh"
 
 ret=$?
index abeed2caed0771ddcaabb5cc86e70de59f425028..b587ddd9ac352d1a66bd49169bf6867c03bd9b19 100755 (executable)
@@ -56,7 +56,7 @@ export TZ="UTC"
 
 skip_if_no_datefudge
 
-gnutls_timewrapper_standalone "2012-09-02" timeout 1800 \
+"$FAKETIME" "2012-09-02" timeout 1800 \
 "${srcdir}/testcompat-openssl-serv-common.sh" ":%COMPAT"
 
 ret=$?
index 9b79afcf6f21fa20ca0b6ae387b43532df9af029..f7291ab9b73d0307ca9c28830870cb5aa9f25782 100755 (executable)
@@ -56,7 +56,7 @@ export TZ="UTC"
 
 skip_if_no_datefudge
 
-gnutls_timewrapper_standalone "2012-09-02" timeout 1800 \
+"$FAKETIME" "2012-09-02" timeout 1800 \
 "${srcdir}/testcompat-openssl-serv-common.sh" ":%NO_ETM"
 
 ret=$?
index fee57369d29d0dfe4e8a8d7905083aafaa897253..5ac1b121c9964cf83bee4794964c71f77a25ff1f 100755 (executable)
@@ -56,7 +56,7 @@ export TZ="UTC"
 
 skip_if_no_datefudge
 
-gnutls_timewrapper_standalone "2012-09-02" timeout 1800 \
+"$FAKETIME" "2012-09-02" timeout 1800 \
 "${srcdir}/testcompat-openssl-serv-common.sh" ":%DISABLE_SAFE_RENEGOTIATION"
 
 ret=$?
index eab663c7d88e5ddb723b325c516187c0ede5bbe1..33716f252622474363804c838f9b998afe74ebb2 100755 (executable)
@@ -56,7 +56,7 @@ export TZ="UTC"
 
 skip_if_no_datefudge
 
-gnutls_timewrapper_standalone "2012-09-02" timeout 1800 \
+"$FAKETIME" "2012-09-02" timeout 1800 \
 "${srcdir}/testcompat-openssl-serv-common.sh" ":%NO_TICKETS"
 
 ret=$?
index e58e20b49d056a815e3db81ef839e2e7e3fab0ff..1acc1889ed34cad15864c4ab18cc6d2a02ebaf6b 100755 (executable)
@@ -56,7 +56,7 @@ export TZ="UTC"
 
 skip_if_no_datefudge
 
-gnutls_timewrapper_standalone "2012-09-02" timeout 1800 \
+"$FAKETIME" "2012-09-02" timeout 1800 \
 "${srcdir}/testcompat-openssl-serv-common.sh" ":%SAFE_RENEGOTIATION"
 
 ret=$?
index 454a1b3f75e12cbae63b66870e63829e14330bb0..ed24271376edf77281a8c63b471d6319459b230d 100755 (executable)
@@ -56,7 +56,7 @@ export TZ="UTC"
 
 skip_if_no_datefudge
 
-gnutls_timewrapper_standalone "2012-09-02" timeout 1800 \
+"$FAKETIME" "2012-09-02" timeout 1800 \
 "${srcdir}/testcompat-openssl-serv-common.sh"
 
 ret=$?
index aee90db4ce0e45574a06e2ff99c07144cf9b769e..1ce04b9dd14fe1aaadf5d8eeacd0d85f6c2d13ca 100755 (executable)
@@ -50,7 +50,7 @@ if test $? = 0; then
        exit 77
 fi
 
-gnutls_timewrapper_standalone "2012-09-02" timeout 1800 \
+"$FAKETIME" "2012-09-02" timeout 1800 \
 "${srcdir}/testcompat-polarssl-serv-common.sh" ":%COMPAT"
 
 ret=$?
index 8212a88a11074429d3cb26ef66d6ce3c25e5618a..36afa600e575276808536998f1c1783d35535e1f 100755 (executable)
@@ -50,7 +50,7 @@ if test $? = 0; then
        exit 77
 fi
 
-gnutls_timewrapper_standalone "2012-09-02" timeout 1800 \
+"$FAKETIME" "2012-09-02" timeout 1800 \
 "${srcdir}/testcompat-polarssl-serv-common.sh" ":%NO_ETM"
 
 ret=$?
index f9af51c11a442cd70868176851f61c9053313e19..21a0b5393fd61471094c55cd1d82bc82b0f0de75 100755 (executable)
@@ -50,7 +50,7 @@ if test $? = 0; then
        exit 77
 fi
 
-gnutls_timewrapper_standalone "2012-09-02" timeout 1800 \
+"$FAKETIME" "2012-09-02" timeout 1800 \
 "${srcdir}/testcompat-polarssl-serv-common.sh"
 
 ret=$?
index 409057d97c8ebdc3bca376e1f40453ab30b0a3b3..099c70a2890772a0bdb296bb2e705a3c7bc4e0a6 100755 (executable)
@@ -62,17 +62,17 @@ _EOF_
 export GNUTLS_DEBUG_LEVEL=3
 unset GNUTLS_SYSTEM_PRIORITY_FILE
 
-gnutls_timewrapper_standalone "2017-11-22" \
+"$FAKETIME" "2017-11-22" \
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" --logfile ${TMPFILE2} </dev/null >/dev/null ||
        fail "expected connection to succeed (1)"
 
 export GNUTLS_SYSTEM_PRIORITY_FILE="${TMPFILE}"
 
-gnutls_timewrapper_standalone "2017-11-22" \
+"$FAKETIME" "2017-11-22" \
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:%PROFILE_LOW --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" --logfile ${TMPFILE2} </dev/null >/dev/null ||
        fail "expected connection to succeed (2)"
 
-gnutls_timewrapper_standalone "2017-11-22" \
+"$FAKETIME" "2017-11-22" \
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:%PROFILE_MEDIUM --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" --logfile ${TMPFILE2} </dev/null >/dev/null ||
        fail "expected connection to succeed (3)"
 
@@ -85,17 +85,17 @@ _EOF_
 
 unset GNUTLS_SYSTEM_PRIORITY_FILE
 
-gnutls_timewrapper_standalone "2017-11-22" \
+"$FAKETIME" "2017-11-22" \
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" --logfile ${TMPFILE2} </dev/null >/dev/null ||
        fail "expected connection to succeed (1)"
 
 export GNUTLS_SYSTEM_PRIORITY_FILE="${TMPFILE}"
 
-gnutls_timewrapper_standalone "2017-11-22" \
+"$FAKETIME" "2017-11-22" \
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:%PROFILE_LOW --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" --logfile ${TMPFILE2} </dev/null >/dev/null &&
        fail "expected connection to fail (1)"
 
-gnutls_timewrapper_standalone "2017-11-22" \
+"$FAKETIME" "2017-11-22" \
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:%PROFILE_MEDIUM --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" --logfile ${TMPFILE2} </dev/null >/dev/null &&
        fail "expected connection to fail (2)"
 
index b4623d992767291b8f852751e60e39c7b5edf515..93553479c4fc9ef0573a945e2eba6a7895557229 100755 (executable)
@@ -53,11 +53,11 @@ wait_server ${PID}
 #successful case, test whether the ciphers we disable below work
 echo "Sanity testing"
 
-gnutls_timewrapper_standalone "2017-11-22" \
+"$FAKETIME" "2017-11-22" \
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:-CIPHER-ALL:+AES-128-GCM:-GROUP-ALL:+GROUP-FFDHE2048 --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" </dev/null >/dev/null ||
        fail ${PID} "stage1: expected connection to succeed (1)"
 
-gnutls_timewrapper_standalone "2017-11-22" \
+"$FAKETIME" "2017-11-22" \
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:-VERS-ALL:+VERS-TLS1.2:-CIPHER-ALL:+AES-128-CBC:+AES-256-CBC:-MAC-ALL:+SHA1 --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" </dev/null >/dev/null ||
        fail ${PID} "stage1: expected connection to succeed (2)"
 
@@ -76,43 +76,43 @@ export GNUTLS_SYSTEM_PRIORITY_FILE
 
 echo "Testing TLS1.3"
 echo " * sanity"
-gnutls_timewrapper_standalone "2017-11-22" \
+"$FAKETIME" "2017-11-22" \
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" </dev/null >/dev/null ||
        fail ${PID} "stage2: expected connection to succeed (1)"
 
 echo " * fallback to good options"
-gnutls_timewrapper_standalone "2017-11-22" \
+"$FAKETIME" "2017-11-22" \
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:-CIPHER-ALL:+AES-128-GCM:+AES-256-GCM:-GROUP-ALL:+GROUP-FFDHE2048:+GROUP-FFDHE3072 --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" </dev/null >/dev/null ||
        fail ${PID} "stage2: expected connection to succeed (2)"
 
 echo " * disabled cipher"
-gnutls_timewrapper_standalone "2017-11-22" \
+"$FAKETIME" "2017-11-22" \
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:-CIPHER-ALL:+AES-128-GCM --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" </dev/null && #>/dev/null &&
        fail ${PID} "stage2: expected connection to fail (1)"
 
 echo " * disabled group"
-gnutls_timewrapper_standalone "2017-11-22" \
+"$FAKETIME" "2017-11-22" \
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:-GROUP-ALL:+GROUP-FFDHE2048 --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" </dev/null >/dev/null &&
        fail ${PID} "stage2: expected connection to fail (2)"
 
 echo "Testing TLS1.2"
 echo " * sanity"
-gnutls_timewrapper_standalone "2017-11-22" \
+"$FAKETIME" "2017-11-22" \
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:-VERS-ALL:+VERS-TLS1.2 --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" </dev/null >/dev/null ||
        fail ${PID} "stage3: expected connection to succeed (1)"
 
 echo " * fallback to good options"
-gnutls_timewrapper_standalone "2017-11-22" \
+"$FAKETIME" "2017-11-22" \
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:-VERS-ALL:+VERS-TLS1.2:-CIPHER-ALL:+AES-128-CBC:+AES-256-CBC:+AES-256-GCM:-MAC-ALL:+SHA1:+AEAD --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" </dev/null >/dev/null ||
        fail ${PID} "stage3: expected connection to succeed (2)"
 
 echo " * disabled cipher"
-gnutls_timewrapper_standalone "2017-11-22" \
+"$FAKETIME" "2017-11-22" \
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:-VERS-ALL:+VERS-TLS1.2:-CIPHER-ALL:+AES-128-CBC --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" </dev/null >/dev/null &&
        fail ${PID} "stage3: expected connection to fail (1)"
 
 echo " * disabled MAC"
-gnutls_timewrapper_standalone "2017-11-22" \
+"$FAKETIME" "2017-11-22" \
 "${CLI}" -p "${PORT}" 127.0.0.1 --priority NORMAL:-VERS-ALL:+VERS-TLS1.2:-MAC-ALL:+SHA1 --verify-hostname localhost --x509cafile "${srcdir}/certs/ca-cert-ecc.pem" </dev/null >/dev/null &&
        fail ${PID} "stage3: expected connection to fail (2)"
 
index fdc1bb3a26d6bd20f42ac6556d13f8cd8de96bbf..3449a1d8e281375bf88aed62f9c6cc827f49eebf 100755 (executable)
@@ -561,7 +561,7 @@ write_certificate_test () {
        pubkey="$5"
 
        echo -n "* Generating client certificate... "
-       gnutls_timewrapper_standalone static "$TESTDATE" \
+       "$FAKETIME" "$FAKETIME_F_OPT" "$TESTDATE" \
        "${CERTTOOL}" ${CERTTOOL_PARAM} ${ADDITIONAL_PARAM}  --generate-certificate --load-ca-privkey "${cakey}"  --load-ca-certificate "${cacert}"  \
        --template ${srcdir}/testpkcs11-certs/client-tmpl --load-privkey "${token};object=gnutls-client;object-type=private" \
        --load-pubkey "$pubkey" --outfile tmp-client.crt >>"${LOGFILE}" 2>&1
@@ -939,7 +939,7 @@ use_certificate_test () {
        echo -n "* Using PKCS #11 with gnutls-cli (${txt})... "
        # start server
        eval "${GETPORT}"
-       launch_bare_server gnutls_timewrapper_standalone static "$TESTDATE" \
+       launch_bare_server "$FAKETIME" "$FAKETIME_F_OPT" "$TESTDATE" \
                $VALGRIND $SERV $DEBUG -p "$PORT" \
                ${ADDITIONAL_PARAM} --debug 10 --echo --priority NORMAL --x509certfile="${certfile}" \
                --x509keyfile="$keyfile" --x509cafile="${cafile}" \
@@ -949,16 +949,16 @@ use_certificate_test () {
        wait_server ${PID}
 
        # connect to server using SC
-       gnutls_timewrapper_standalone static "$TESTDATE" \
+       "$FAKETIME" "$FAKETIME_F_OPT" "$TESTDATE" \
        ${VALGRIND} "${CLI}" ${ADDITIONAL_PARAM} -p "${PORT}" localhost --priority NORMAL --x509cafile="${cafile}" </dev/null >>"${LOGFILE}" 2>&1 && \
                fail ${PID} "Connection should have failed!"
 
-       gnutls_timewrapper_standalone static "$TESTDATE" \
+       "$FAKETIME" "$FAKETIME_F_OPT" "$TESTDATE" \
        ${VALGRIND} "${CLI}" ${ADDITIONAL_PARAM} -p "${PORT}" localhost --priority NORMAL --x509certfile="${certfile}" \
        --x509keyfile="$keyfile" --x509cafile="${cafile}" </dev/null >>"${LOGFILE}" 2>&1 || \
                fail ${PID} "Connection (with files) should have succeeded!"
 
-       gnutls_timewrapper_standalone static "$TESTDATE" \
+       "$FAKETIME" "$FAKETIME_F_OPT" "$TESTDATE" \
        ${VALGRIND} "${CLI}" ${ADDITIONAL_PARAM} -p "${PORT}" localhost --priority NORMAL --x509certfile="${token};object=gnutls-client;object-type=cert" \
                --x509keyfile="${token};object=gnutls-client;object-type=private" \
                --x509cafile="${cafile}" </dev/null >>"${LOGFILE}" 2>&1 || \