From 537827ebde184ab5c0c25ddc8017ebdaf5bcf740 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 9 Aug 2024 14:51:51 -0700 Subject: [PATCH 1/2] Add missing config.h on some .c files. --- examples/async/async_client.c | 4 ++++ examples/async/async_server.c | 4 ++++ examples/async/async_tls.c | 4 ++++ examples/sctp/sctp-client-dtls.c | 3 +++ examples/sctp/sctp-client.c | 4 ++++ examples/sctp/sctp-server-dtls.c | 4 ++++ examples/sctp/sctp-server.c | 4 ++++ mcapi/mcapi_test.c | 4 +++- wolfcrypt/src/port/Renesas/renesas_common.c | 4 ++++ wolfcrypt/src/port/Renesas/renesas_fspsm_util.c | 6 +++++- wolfcrypt/src/port/Renesas/renesas_tsip_util.c | 5 +++++ wolfcrypt/src/port/caam/caam_driver.c | 4 ++++ wolfcrypt/src/port/caam/caam_error.c | 4 ++++ wolfcrypt/src/port/mynewt/mynewt_port.c | 12 +++++++++--- wolfcrypt/src/port/st/stsafe.c | 4 ++++ wolfcrypt/src/wc_kyber_poly.c | 4 ++++ wolfcrypt/src/wc_lms_impl.c | 4 ++++ wrapper/Ada/ada_binding.c | 4 ++++ 18 files changed, 77 insertions(+), 5 deletions(-) diff --git a/examples/async/async_client.c b/examples/async/async_client.c index 27d66df9ce..114f10728b 100644 --- a/examples/async/async_client.c +++ b/examples/async/async_client.c @@ -22,6 +22,10 @@ /* TLS client demonstrating asynchronous cryptography features and optionally * using the crypto or PK callbacks */ +#ifdef HAVE_CONFIG_H + #include +#endif + /* std */ #include #include diff --git a/examples/async/async_server.c b/examples/async/async_server.c index 6740c0b37c..7a782de7cb 100644 --- a/examples/async/async_server.c +++ b/examples/async/async_server.c @@ -22,6 +22,10 @@ /* TLS server demonstrating asynchronous cryptography features and optionally * using the crypto or PK callbacks */ +#ifdef HAVE_CONFIG_H + #include +#endif + /* std */ #include #include diff --git a/examples/async/async_tls.c b/examples/async/async_tls.c index 4ab9de003c..a68f3b4dbf 100644 --- a/examples/async/async_tls.c +++ b/examples/async/async_tls.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif + #ifndef WOLFSSL_USER_SETTINGS #include #endif diff --git a/examples/sctp/sctp-client-dtls.c b/examples/sctp/sctp-client-dtls.c index 36be1aed41..2f925d10dc 100644 --- a/examples/sctp/sctp-client-dtls.c +++ b/examples/sctp/sctp-client-dtls.c @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif /* wolfssl */ #ifndef WOLFSSL_USER_SETTINGS diff --git a/examples/sctp/sctp-client.c b/examples/sctp/sctp-client.c index b76639f484..04e3c56b86 100644 --- a/examples/sctp/sctp-client.c +++ b/examples/sctp/sctp-client.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif + #ifndef WOLFSSL_USER_SETTINGS #include #endif diff --git a/examples/sctp/sctp-server-dtls.c b/examples/sctp/sctp-server-dtls.c index 530a4b65b5..bbe9835a05 100644 --- a/examples/sctp/sctp-server-dtls.c +++ b/examples/sctp/sctp-server-dtls.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif + /* wolfssl */ #ifndef WOLFSSL_USER_SETTINGS #include diff --git a/examples/sctp/sctp-server.c b/examples/sctp/sctp-server.c index 71143e8057..2f33ada327 100644 --- a/examples/sctp/sctp-server.c +++ b/examples/sctp/sctp-server.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif + #ifndef WOLFSSL_USER_SETTINGS #include #endif diff --git a/mcapi/mcapi_test.c b/mcapi/mcapi_test.c index 64aee92639..16d929749b 100644 --- a/mcapi/mcapi_test.c +++ b/mcapi/mcapi_test.c @@ -23,7 +23,9 @@ /* Tests Microchip CRYPTO API layer */ - +#ifdef HAVE_CONFIG_H + #include +#endif /* mc api header */ #include diff --git a/wolfcrypt/src/port/Renesas/renesas_common.c b/wolfcrypt/src/port/Renesas/renesas_common.c index a55a01ad01..6924b31ebf 100644 --- a/wolfcrypt/src/port/Renesas/renesas_common.c +++ b/wolfcrypt/src/port/Renesas/renesas_common.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #if defined(WOLFSSL_RENESAS_FSPSM_TLS) || \ diff --git a/wolfcrypt/src/port/Renesas/renesas_fspsm_util.c b/wolfcrypt/src/port/Renesas/renesas_fspsm_util.c index c955b571c6..e8558c6a82 100644 --- a/wolfcrypt/src/port/Renesas/renesas_fspsm_util.c +++ b/wolfcrypt/src/port/Renesas/renesas_fspsm_util.c @@ -18,8 +18,12 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#include +#ifdef HAVE_CONFIG_H + #include +#endif + +#include #if defined(WOLFSSL_RENESAS_RSIP) || \ defined(WOLFSSL_RENESAS_SCEPROTECT) diff --git a/wolfcrypt/src/port/Renesas/renesas_tsip_util.c b/wolfcrypt/src/port/Renesas/renesas_tsip_util.c index 6097eb0e16..a6b2a29019 100644 --- a/wolfcrypt/src/port/Renesas/renesas_tsip_util.c +++ b/wolfcrypt/src/port/Renesas/renesas_tsip_util.c @@ -18,6 +18,11 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ + +#ifdef HAVE_CONFIG_H + #include +#endif + #include #if defined(WOLFSSL_RENESAS_TSIP) diff --git a/wolfcrypt/src/port/caam/caam_driver.c b/wolfcrypt/src/port/caam/caam_driver.c index c0c212fb91..d98574f688 100644 --- a/wolfcrypt/src/port/caam/caam_driver.c +++ b/wolfcrypt/src/port/caam/caam_driver.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif + #if (defined(__INTEGRITY) || defined(INTEGRITY)) || \ (defined(__QNX__) || defined(__QNXNTO__)) diff --git a/wolfcrypt/src/port/caam/caam_error.c b/wolfcrypt/src/port/caam/caam_error.c index d1ae990614..ba52aa5778 100644 --- a/wolfcrypt/src/port/caam/caam_error.c +++ b/wolfcrypt/src/port/caam/caam_error.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif + #if (defined(__INTEGRITY) || defined(INTEGRITY)) || \ (defined(__QNX__) || defined(__QNXNTO__)) diff --git a/wolfcrypt/src/port/mynewt/mynewt_port.c b/wolfcrypt/src/port/mynewt/mynewt_port.c index 06d28ddc9c..736098df6f 100644 --- a/wolfcrypt/src/port/mynewt/mynewt_port.c +++ b/wolfcrypt/src/port/mynewt/mynewt_port.c @@ -19,8 +19,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ -#if defined(WOLFSSL_APACHE_MYNEWT) +#ifdef HAVE_CONFIG_H + #include +#endif + +#ifdef WOLFSSL_APACHE_MYNEWT + #ifndef NO_FILESYSTEM + #include "fs/fs.h" #define FILE struct fs_file @@ -142,5 +148,5 @@ int mynewt_fclose(FILE *stream) return 0; } -#endif /* NO_FILESYSTEM*/ -#endif /* if defined(WOLFSSL_APACHE_MYNEWT) */ +#endif /* !NO_FILESYSTEM */ +#endif /* WOLFSSL_APACHE_MYNEWT */ diff --git a/wolfcrypt/src/port/st/stsafe.c b/wolfcrypt/src/port/st/stsafe.c index fad4e8ee5c..be291f0363 100644 --- a/wolfcrypt/src/port/st/stsafe.c +++ b/wolfcrypt/src/port/st/stsafe.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include #include diff --git a/wolfcrypt/src/wc_kyber_poly.c b/wolfcrypt/src/wc_kyber_poly.c index aed437c29f..911c5ac3ed 100644 --- a/wolfcrypt/src/wc_kyber_poly.c +++ b/wolfcrypt/src/wc_kyber_poly.c @@ -57,6 +57,10 @@ * some platforms and is smaller in code size. */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include #include diff --git a/wolfcrypt/src/wc_lms_impl.c b/wolfcrypt/src/wc_lms_impl.c index 3f48420b4a..86037d4646 100644 --- a/wolfcrypt/src/wc_lms_impl.c +++ b/wolfcrypt/src/wc_lms_impl.c @@ -37,6 +37,10 @@ * Enable when memory is limited. */ +#ifdef HAVE_CONFIG_H + #include +#endif + #include #include diff --git a/wrapper/Ada/ada_binding.c b/wrapper/Ada/ada_binding.c index a1b762846b..72fd8b475b 100644 --- a/wrapper/Ada/ada_binding.c +++ b/wrapper/Ada/ada_binding.c @@ -19,6 +19,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef HAVE_CONFIG_H + #include +#endif + /* wolfSSL */ #include #include From 08622bab390d389ad4adea06c858052714df15ed Mon Sep 17 00:00:00 2001 From: David Garske Date: Mon, 12 Aug 2024 09:29:20 -0700 Subject: [PATCH 2/2] Fix to remove NO_BIG_INT from `MICROCHIP_PIC32` in settings.h. --- wolfssl/wolfcrypt/settings.h | 1 - 1 file changed, 1 deletion(-) diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 25b961479b..8b6dd7c6d7 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -695,7 +695,6 @@ #define NO_DEV_RANDOM #define NO_FILESYSTEM #define TFM_TIMING_RESISTANT - #define NO_BIG_INT #endif #ifdef WOLFSSL_MICROCHIP_PIC32MZ