Skip to content

Commit 3969dd5

Browse files
authored
Merge pull request #8596 from dgarske/various_isacii_keylog
Various improvements to iscacii and CMake key log
2 parents 1c56a26 + a59075b commit 3969dd5

3 files changed

Lines changed: 23 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ check_function_exists("socket" HAVE_SOCKET)
125125
check_function_exists("strftime" HAVE_STRFTIME)
126126
check_function_exists("__atomic_fetch_add" HAVE_C___ATOMIC)
127127

128+
include(CheckSymbolExists)
129+
check_symbol_exists(isascii "ctype.h" HAVE_ISASCII)
130+
128131
include(CheckTypeSize)
129132

130133
check_type_size("__uint128_t" __UINT128_T)
@@ -893,7 +896,7 @@ endif()
893896
# - SEP
894897

895898
add_option("WOLFSSL_KEYGEN"
896-
"Enable key generation (default: disabled)])"
899+
"Enable key generation (default: disabled)"
897900
"no" "yes;no")
898901

899902
add_option("WOLFSSL_CERTGEN"
@@ -2320,6 +2323,18 @@ if (ENABLE_SCCACHE AND (NOT WOLFSSL_SCCACHE_ALREADY_SET_FLAG))
23202323
endif()
23212324
endif()
23222325

2326+
add_option("WOLFSSL_KEYLOG_EXPORT"
2327+
"Enable insecure export of TLS secrets to an NSS keylog file (default: disabled)"
2328+
"no" "yes;no")
2329+
if(WOLFSSL_KEYLOG_EXPORT)
2330+
message(WARNING "Keylog export enabled -- Sensitive key data will be stored insecurely.")
2331+
list(APPEND WOLFSSL_DEFINITIONS
2332+
"-DSHOW_SECRETS"
2333+
"-DHAVE_SECRET_CALLBACK"
2334+
"-DWOLFSSL_SSLKEYLOGFILE"
2335+
"-DWOLFSSL_KEYLOG_EXPORT_WARNED")
2336+
endif()
2337+
23232338

23242339
file(REMOVE ${OPTION_FILE})
23252340

configure.ac

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ then
119119
AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_EXPERIMENTAL_SETTINGS"
120120
fi
121121

122-
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])
122+
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])
123123
AC_CHECK_LIB([network],[socket])
124124
AC_C_BIGENDIAN
125125
AC_C___ATOMIC
@@ -129,8 +129,8 @@ AC_CHECK_HEADER(assert.h, [AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSL_HAVE_ASSERT_H"],[
129129
# check if functions of interest are linkable, but also check if
130130
# they're declared by the expected headers, and if not, supersede the
131131
# unusable positive from AC_CHECK_FUNCS().
132-
AC_CHECK_FUNCS([gethostbyname getaddrinfo gettimeofday gmtime_r gmtime_s inet_ntoa memset socket strftime atexit])
133-
AC_CHECK_DECLS([gethostbyname, getaddrinfo, gettimeofday, gmtime_r, gmtime_s, inet_ntoa, memset, socket, strftime, atexit], [], [
132+
AC_CHECK_FUNCS([gethostbyname getaddrinfo gettimeofday gmtime_r gmtime_s inet_ntoa memset socket strftime atexit isascii])
133+
AC_CHECK_DECLS([gethostbyname, getaddrinfo, gettimeofday, gmtime_r, gmtime_s, inet_ntoa, memset, socket, strftime, atexit, isascii], [], [
134134
if test "$(eval echo \$"$(eval 'echo ac_cv_func_${as_decl_name}')")" = "yes"
135135
then
136136
AC_MSG_NOTICE([ note: earlier check for $(eval 'echo ${as_decl_name}') superseded.])
@@ -160,6 +160,9 @@ fi
160160
#ifdef HAVE_STDLIB_H
161161
#include <stdlib.h>
162162
#endif
163+
#ifdef HAVE_CTYPE_H
164+
#include <ctype.h>
165+
#endif
163166
]])
164167

165168
AC_PROG_INSTALL

wolfssl/wolfcrypt/types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ typedef struct w64wrapper {
10051005
#endif
10061006
#if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
10071007
#define XISALNUM(c) isalnum((c))
1008-
#ifdef NO_STDLIB_ISASCII
1008+
#if !defined(HAVE_ISASCII) || defined(NO_STDLIB_ISASCII)
10091009
#define XISASCII(c) (((c) >= 0 && (c) <= 127) ? 1 : 0)
10101010
#else
10111011
#define XISASCII(c) isascii((c))

0 commit comments

Comments
 (0)