cast to resolve warning, check size of time_t, and check for null test case

This commit is contained in:
Jacob Barthelmeh
2018-11-12 16:02:33 -07:00
parent 7a2a66743b
commit 0f4a06594e
5 changed files with 11 additions and 3 deletions

View File

@@ -66,6 +66,7 @@ AS_IF([ test -n "$CFLAG_VISIBILITY" ], [
# checks to fail.
AC_CHECK_SIZEOF([long long])
AC_CHECK_SIZEOF([long])
AC_CHECK_SIZEOF([time_t])
AC_CHECK_TYPES([__uint128_t])
AC_CHECK_FUNCS([gethostbyname getaddrinfo gettimeofday gmtime_r inet_ntoa memset socket])
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h sys/ioctl.h sys/socket.h sys/time.h errno.h])

View File

@@ -4204,7 +4204,7 @@ int InitSSL_Suites(WOLFSSL* ssl)
haveRSA = 1;
#endif
#ifndef NO_PSK
havePSK = ssl->options.havePSK;
havePSK = (byte)ssl->options.havePSK;
#endif /* NO_PSK */
#ifdef HAVE_ANON
haveAnon = ssl->options.haveAnon;

View File

@@ -911,7 +911,7 @@ static int test_cm_load_ca_file(const char* ca_cert_file)
if (ret == 0) {
/* test loading DER */
ret = wc_PemToDer(cert_buf, cert_sz, CA_TYPE, &pDer, NULL, NULL, NULL);
if (ret == 0) {
if (ret == 0 && pDer != NULL) {
ret = test_cm_load_ca_buffer(pDer->buffer, pDer->length,
WOLFSSL_FILETYPE_ASN1);

View File

@@ -10117,7 +10117,8 @@ static int rsa_certgen_test(RsaKey* key, RsaKey* keypub, WC_RNG* rng, byte* tmp)
fclose(file3);
#endif /* USE_CERT_BUFFERS */
#ifndef NO_FILESYSTEM
#if !defined(NO_FILESYSTEM) && !defined(USE_CERT_BUFFERS_1024) && \
!defined(USE_CERT_BUFFERS_2048) && !defined(NO_ASN)
ret = wc_SetAltNames(myCert, rsaCaCertFile);
if (ret != 0) {
ERROR_OUT(-6931, exit_rsa);

View File

@@ -478,6 +478,12 @@ WOLFSSL_API int wolfCrypt_Cleanup(void);
#endif
#endif
#ifdef SIZEOF_TIME_T
#if SIZEOF_TIME_T < 8
#undef TIME_T_NOT_LONG
#define TIME_T_NOT_LONG
#endif
#endif
/* Map default time functions */
#if !defined(XTIME) && !defined(TIME_OVERRIDES) && !defined(USER_TIME)