Skip to content

Commit

Permalink
Merge pull request wolfSSL#8132 from douzzer/20241024-opensslcoexist-…
Browse files Browse the repository at this point in the history
…opensslextra

20241024-opensslcoexist-opensslextra
  • Loading branch information
dgarske authored Nov 1, 2024
2 parents ca6d49d + 950ee40 commit 836b741
Show file tree
Hide file tree
Showing 73 changed files with 4,530 additions and 3,625 deletions.
2 changes: 1 addition & 1 deletion cmake/options.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ extern "C" {
#undef GCM_WORD32
#cmakedefine GCM_WORD32
#undef HAVE___UINT128_T
#cmakedefine HAVE___UINT128_T
#cmakedefine HAVE___UINT128_T 1
#undef HAVE_AES_KEYWRAP
#cmakedefine HAVE_AES_KEYWRAP
#undef HAVE_AESCCM
Expand Down
99 changes: 63 additions & 36 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -896,36 +896,35 @@ then
fi



# ALL FEATURES
# All features, except conflicting or experimental:
AC_ARG_ENABLE([all],
[AS_HELP_STRING([--enable-all],[Enable all wolfSSL features, except SSLv3 (default: disabled)])],
[ ENABLED_ALL=$enableval ],
[ ENABLED_ALL=no ]
)
if test "$ENABLED_ALL" = "yes"
then
enable_all_crypto=yes
test "$enable_all_crypto" = "" && enable_all_crypto=yes

test "$enable_all_osp" = "" && test "$ENABLED_LINUXKM_DEFAULTS" != "yes" && enable_all_osp=yes

test "$enable_dtls" = "" && enable_dtls=yes
if test "x$FIPS_VERSION" != "xv1"
then
test "$enable_tls13" = "" && enable_tls13=yes
test "$enable_rsapss" = "" && enable_rsapss=yes
fi

test "$enable_savesession" = "" && enable_savesession=yes
test "$enable_savecert" = "" && enable_savecert=yes
test "$enable_postauth" = "" && enable_postauth=yes
test "$enable_hrrcookie" = "" && enable_hrrcookie=yes
test "$enable_fallback_scsv" = "" && enable_fallback_scsv=yes
test "$enable_webserver" = "" && enable_webserver=yes
test "$enable_crl_monitor" = "" && enable_crl_monitor=yes
test "$enable_sni" = "" && enable_sni=yes
test "$enable_maxfragment" = "" && enable_maxfragment=yes
test "$enable_alpn" = "" && enable_alpn=yes
test "$enable_truncatedhmac" = "" && enable_truncatedhmac=yes
test "$enable_trusted_ca" = "" && enable_trusted_ca=yes
test "$enable_trustedca" = "" && enable_trustedca=yes
test "$enable_session_ticket" = "" && enable_session_ticket=yes
test "$enable_earlydata" = "" && enable_earlydata=yes
test "$enable_ech" = "" && enable_ech=yes
Expand All @@ -942,41 +941,16 @@ then
# linuxkm is incompatible with opensslextra and its dependents.
if test "$ENABLED_LINUXKM_DEFAULTS" != "yes"
then
if test "$ENABLED_FIPS" = "no"
then
if test "$ENABLED_32BIT" != "yes"
then
test "$enable_openssh" = "" && enable_openssh=yes
fi
# S/MIME support requires PKCS7, which requires no FIPS.
test "$enable_smime" = "" && enable_smime=yes
fi
test "$enable_opensslextra" = "" && enable_opensslextra=yes
test "$enable_opensslall" = "" && enable_opensslall=yes
test "$enable_certservice" = "" && enable_certservice=yes
test "$enable_lighty" = "" && enable_lighty=yes
test "$enable_nginx" = "" && enable_nginx=yes
test "$enable_openvpn" = "" && enable_openvpn=yes
test "$enable_asio" = "" && enable_asio=yes
test "$enable_libwebsockets" = "" && enable_libwebsockets=yes
if test "$ENABLED_FIPS" = "no" || test "$HAVE_FIPS_VERSION" -le 5; then
test "$enable_qt" = "" && enable_qt=yes
fi
fi
fi

if test "$ENABLED_FIPS" = "no"
then
test "$enable_scep" = "" && enable_scep=yes
test "$enable_mcast" = "" && enable_mcast=yes

if test "$ENABLED_LINUXKM_DEFAULTS" != "yes"
then
# these use DES3:
test "$enable_stunnel" = "" && enable_stunnel=yes
test "$enable_curl" = "" && enable_curl=yes
test "$enable_tcpdump" = "" && enable_tcpdump=yes
fi
fi

if test "$ENABLED_FIPS" = "no" || test "$HAVE_FIPS_VERSION" -ge 6
Expand All @@ -997,6 +971,57 @@ then
fi


# All OSP meta-features:
AC_ARG_ENABLE([all-osp],
[AS_HELP_STRING([--enable-all-osp],[Enable all OSP meta feature sets (default: disabled)])],
[ ENABLED_ALL_OSP=$enableval ],
[ ENABLED_ALL_OSP=no]
)

if test "$ENABLED_ALL_OSP" = "yes"
then
if test "$ENABLED_LINUXKM_DEFAULTS" = "yes"
then
AC_MSG_ERROR([--enable-all-osp is incompatible with --enable-linuxkm-defaults])
fi

test "$enable_webserver" = "" && enable_webserver=yes

if test "$ENABLED_SP_MATH" = "no"
then
if test "$ENABLED_FIPS" = "no"
then
# S/MIME support requires PKCS7, which requires no FIPS.
test "$enable_smime" = "" && enable_smime=yes
if test "$ENABLED_32BIT" != "yes"
then
test "$enable_openssh" = "" && enable_openssh=yes
fi
fi

if test "$ENABLED_ALL_OSP" != "no"
then
test "$enable_lighty" = "" && enable_lighty=yes
test "$enable_nginx" = "" && enable_nginx=yes
test "$enable_openvpn" = "" && enable_openvpn=yes
test "$enable_asio" = "" && enable_asio=yes
test "$enable_libwebsockets" = "" && enable_libwebsockets=yes
if test "$ENABLED_FIPS" = "no" || test "$HAVE_FIPS_VERSION" -le 5; then
test "$enable_qt" = "" && enable_qt=yes
fi
fi
fi

if test "$ENABLED_FIPS" = "no"
then
# these use DES3:
test "$enable_stunnel" = "" && enable_stunnel=yes
test "$enable_curl" = "" && enable_curl=yes
test "$enable_tcpdump" = "" && enable_tcpdump=yes
fi
fi


# Auto-selected activation of all applicable asm accelerations

# Enable asm automatically only if the compiler advertises itself as full Gnu C.
Expand Down Expand Up @@ -1093,7 +1118,7 @@ then
fi


# ALL CRYPTO FEATURES
# All wolfCrypt features:
AC_ARG_ENABLE([all-crypto],
[AS_HELP_STRING([--enable-all-crypto],[Enable all wolfcrypt algorithms (default: disabled)])],
[ ENABLED_ALL_CRYPT=$enableval ],
Expand Down Expand Up @@ -1152,6 +1177,11 @@ then
test "$enable_anon" = "" && enable_anon=yes
test "$enable_ssh" = "" && test "$enable_hmac" != "no" && enable_ssh=yes

if test "x$FIPS_VERSION" != "xv1"
then
test "$enable_rsapss" = "" && enable_rsapss=yes
fi

# sp-math is incompatible with opensslextra, ECC custom curves, and DSA.
if test "$ENABLED_SP_MATH" = "no"
then
Expand Down Expand Up @@ -9354,7 +9384,7 @@ then
AM_CFLAGS="$AM_CFLAGS -DNO_HMAC"
fi
if test "$ENABLED_OPENSSLEXTRA" = "yes" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
if test "$ENABLED_OPENSSLEXTRA" = "yes"
then
AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
fi
Expand Down Expand Up @@ -9575,9 +9605,6 @@ if test "x$ENABLED_OPENSSLCOEXIST" = "xyes"; then
if test "x$ENABLED_OPENSSLALL" = "xyes"; then
AC_MSG_ERROR([Cannot use --enable-opensslcoexist with --enable-opensslall])
fi
if test "x$ENABLED_OPENSSLEXTRA" = "xyes"; then
AC_MSG_ERROR([Cannot use --enable-opensslcoexist with --enable-opensslextra])
fi
fi
if test "$ENABLED_WOLFSSH" = "yes" && test "$ENABLED_HMAC" = "no"
Expand Down
5 changes: 4 additions & 1 deletion examples/benchmark/tls_bench.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,17 @@ Or
bench_tls(args);
*/


#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>

#undef TEST_OPENSSL_COEXIST /* can't use this option with this example */
#undef OPENSSL_COEXIST /* can't use this option with this example */

#include <wolfssl/wolfcrypt/types.h>
#include <wolfssl/wolfcrypt/wc_port.h>
#include <wolfssl/ssl.h>
Expand Down
3 changes: 3 additions & 0 deletions examples/client/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
#endif
#include <wolfssl/wolfcrypt/settings.h>

#undef TEST_OPENSSL_COEXIST /* can't use this option with this example */
#undef OPENSSL_COEXIST /* can't use this option with this example */

#include <wolfssl/ssl.h>

#ifdef WOLFSSL_WOLFSENTRY_HOOKS
Expand Down
17 changes: 11 additions & 6 deletions examples/echoclient/echoclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,19 @@
#endif

#include <wolfssl/wolfcrypt/settings.h>
/* let's use cyassl layer AND cyassl openssl layer */
#undef TEST_OPENSSL_COEXIST /* can't use this option with this example */
#include <wolfssl/ssl.h>
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif

/* Force enable the compatibility macros for this example */
#undef TEST_OPENSSL_COEXIST
#undef OPENSSL_COEXIST
#ifndef OPENSSL_EXTRA_X509_SMALL
#define OPENSSL_EXTRA_X509_SMALL
#endif

#include <wolfssl/ssl.h>

#ifdef WOLFSSL_DTLS
#include <wolfssl/error-ssl.h>
#endif
Expand All @@ -45,9 +53,6 @@

#include <wolfssl/test.h>

#ifndef OPENSSL_EXTRA_X509_SMALL
#define OPENSSL_EXTRA_X509_SMALL
#endif
#include <wolfssl/openssl/ssl.h>

#include <examples/echoclient/echoclient.h>
Expand Down
8 changes: 8 additions & 0 deletions examples/echoserver/echoserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
#include <config.h>
#endif

#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>

#undef TEST_OPENSSL_COEXIST /* can't use this option with this example */
#undef OPENSSL_COEXIST /* can't use this option with this example */

#include <wolfssl/ssl.h> /* name change portability layer */
#include <wolfssl/wolfcrypt/settings.h>
#ifdef HAVE_ECC
Expand Down
2 changes: 2 additions & 0 deletions examples/server/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include <wolfssl/wolfcrypt/settings.h>

#undef TEST_OPENSSL_COEXIST /* can't use this option with this example */
#undef OPENSSL_COEXIST /* can't use this option with this example */

#include <wolfssl/ssl.h> /* name change portability layer */

#ifdef HAVE_ECC
Expand Down
Loading

0 comments on commit 836b741

Please sign in to comment.