Merge pull request #8596 from dgarske/various_isacii_keylog

Various improvements to iscacii and CMake key log
This commit is contained in:
Sean Parkinson
2025-03-28 08:51:49 +10:00
committed by GitHub
3 changed files with 23 additions and 5 deletions

View File

@@ -125,6 +125,9 @@ check_function_exists("socket" HAVE_SOCKET)
check_function_exists("strftime" HAVE_STRFTIME) check_function_exists("strftime" HAVE_STRFTIME)
check_function_exists("__atomic_fetch_add" HAVE_C___ATOMIC) check_function_exists("__atomic_fetch_add" HAVE_C___ATOMIC)
include(CheckSymbolExists)
check_symbol_exists(isascii "ctype.h" HAVE_ISASCII)
include(CheckTypeSize) include(CheckTypeSize)
check_type_size("__uint128_t" __UINT128_T) check_type_size("__uint128_t" __UINT128_T)
@@ -893,7 +896,7 @@ endif()
# - SEP # - SEP
add_option("WOLFSSL_KEYGEN" add_option("WOLFSSL_KEYGEN"
"Enable key generation (default: disabled)])" "Enable key generation (default: disabled)"
"no" "yes;no") "no" "yes;no")
add_option("WOLFSSL_CERTGEN" add_option("WOLFSSL_CERTGEN"
@@ -2320,6 +2323,18 @@ if (ENABLE_SCCACHE AND (NOT WOLFSSL_SCCACHE_ALREADY_SET_FLAG))
endif() endif()
endif() endif()
add_option("WOLFSSL_KEYLOG_EXPORT"
"Enable insecure export of TLS secrets to an NSS keylog file (default: disabled)"
"no" "yes;no")
if(WOLFSSL_KEYLOG_EXPORT)
message(WARNING "Keylog export enabled -- Sensitive key data will be stored insecurely.")
list(APPEND WOLFSSL_DEFINITIONS
"-DSHOW_SECRETS"
"-DHAVE_SECRET_CALLBACK"
"-DWOLFSSL_SSLKEYLOGFILE"
"-DWOLFSSL_KEYLOG_EXPORT_WARNED")
endif()
file(REMOVE ${OPTION_FILE}) file(REMOVE ${OPTION_FILE})

View File

@@ -119,7 +119,7 @@ then
AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_EXPERIMENTAL_SETTINGS" AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_EXPERIMENTAL_SETTINGS"
fi fi
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h time.h sys/ioctl.h sys/socket.h sys/time.h errno.h sys/un.h]) AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h time.h sys/ioctl.h sys/socket.h sys/time.h errno.h sys/un.h ctype.h])
AC_CHECK_LIB([network],[socket]) AC_CHECK_LIB([network],[socket])
AC_C_BIGENDIAN AC_C_BIGENDIAN
AC_C___ATOMIC AC_C___ATOMIC
@@ -129,8 +129,8 @@ AC_CHECK_HEADER(assert.h, [AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSL_HAVE_ASSERT_H"],[
# check if functions of interest are linkable, but also check if # check if functions of interest are linkable, but also check if
# they're declared by the expected headers, and if not, supersede the # they're declared by the expected headers, and if not, supersede the
# unusable positive from AC_CHECK_FUNCS(). # unusable positive from AC_CHECK_FUNCS().
AC_CHECK_FUNCS([gethostbyname getaddrinfo gettimeofday gmtime_r gmtime_s inet_ntoa memset socket strftime atexit]) AC_CHECK_FUNCS([gethostbyname getaddrinfo gettimeofday gmtime_r gmtime_s inet_ntoa memset socket strftime atexit isascii])
AC_CHECK_DECLS([gethostbyname, getaddrinfo, gettimeofday, gmtime_r, gmtime_s, inet_ntoa, memset, socket, strftime, atexit], [], [ AC_CHECK_DECLS([gethostbyname, getaddrinfo, gettimeofday, gmtime_r, gmtime_s, inet_ntoa, memset, socket, strftime, atexit, isascii], [], [
if test "$(eval echo \$"$(eval 'echo ac_cv_func_${as_decl_name}')")" = "yes" if test "$(eval echo \$"$(eval 'echo ac_cv_func_${as_decl_name}')")" = "yes"
then then
AC_MSG_NOTICE([ note: earlier check for $(eval 'echo ${as_decl_name}') superseded.]) AC_MSG_NOTICE([ note: earlier check for $(eval 'echo ${as_decl_name}') superseded.])
@@ -160,6 +160,9 @@ fi
#ifdef HAVE_STDLIB_H #ifdef HAVE_STDLIB_H
#include <stdlib.h> #include <stdlib.h>
#endif #endif
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
]]) ]])
AC_PROG_INSTALL AC_PROG_INSTALL

View File

@@ -1005,7 +1005,7 @@ typedef struct w64wrapper {
#endif #endif
#if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL) #if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
#define XISALNUM(c) isalnum((c)) #define XISALNUM(c) isalnum((c))
#ifdef NO_STDLIB_ISASCII #if !defined(HAVE_ISASCII) || defined(NO_STDLIB_ISASCII)
#define XISASCII(c) (((c) >= 0 && (c) <= 127) ? 1 : 0) #define XISASCII(c) (((c) >= 0 && (c) <= 127) ? 1 : 0)
#else #else
#define XISASCII(c) isascii((c)) #define XISASCII(c) isascii((c))