From c8918dd0be1bbadfcebfc6631bd63f3b3e83befd Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Sat, 17 Oct 2015 23:32:21 -0500 Subject: include warnings about small time_t --- configure.ac | 12 +++++++++--- tests/Makefile.am | 6 ++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index e97991d..148ca64 100644 --- a/configure.ac +++ b/configure.ac @@ -48,9 +48,6 @@ AM_CONDITIONAL([BUILD_CERTHASH], [test "x$ac_cv_func_symlink" = xyes]) # Check if funopen exists AC_CHECK_FUNC([funopen]) -# Check if time_t is sized correctly -AC_CHECK_SIZEOF([time_t], [time.h]) - CHECK_LIBC_COMPAT CHECK_SYSCALL_COMPAT CHECK_CRYPTO_COMPAT @@ -117,6 +114,9 @@ AM_CONDITIONAL([HOST_ASM_ELF_X86_64], AM_CONDITIONAL([HOST_ASM_MACOSX_X86_64], [test "x$HOST_ABI" = "xmacosx" -a "$host_cpu" = "x86_64" -a "x$enable_asm" != "xno"]) +# Check if time_t is sized correctly +AC_CHECK_SIZEOF([time_t], [time.h]) + AC_CONFIG_FILES([ Makefile include/Makefile @@ -135,4 +135,10 @@ AC_CONFIG_FILES([ openssl.pc ]) +AM_CONDITIONAL([SMALL_TIME_T], [test "$ac_cv_sizeof_time_t" = "4"]) +if test "$ac_cv_sizeof_time_t" = "4"; then + echo " ** Warning, this system is unable to represent times past 2038" + echo " ** It will behave incorrectly when handling valid RFC5280 dates" +fi + AC_OUTPUT diff --git a/tests/Makefile.am b/tests/Makefile.am index c56b1ea..6bf3118 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -259,9 +259,15 @@ check_PROGRAMS += rc4test rc4test_SOURCES = rc4test.c # rfc5280time +if SMALL_TIME_T +TESTS += rfc5280time_too_small +check_PROGRAMS += rfc5280time_too_small +rfc5280time_too_small_SOURCES = rfc5280time.c +else TESTS += rfc5280time check_PROGRAMS += rfc5280time rfc5280time_SOURCES = rfc5280time.c +endif # rmdtest TESTS += rmdtest -- cgit v1.2.3-55-g6feb