From 82cb83abee2472f1204ced8ce45fbc89eec6d795 Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 8 May 2025 16:51:37 -0700 Subject: [PATCH] Improvements for portability using older gcc 4.8.2 and customer parsing tools. --- wolfssl/wolfcrypt/cryptocb.h | 2 +- wolfssl/wolfcrypt/ecc.h | 5 +++-- wolfssl/wolfcrypt/port/silabs/silabs_ecc.h | 1 - wolfssl/wolfcrypt/settings.h | 13 ++++++++----- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/wolfssl/wolfcrypt/cryptocb.h b/wolfssl/wolfcrypt/cryptocb.h index f47cb0a25..9bcb35900 100644 --- a/wolfssl/wolfcrypt/cryptocb.h +++ b/wolfssl/wolfcrypt/cryptocb.h @@ -466,7 +466,7 @@ typedef struct wc_CryptoInfo { } wc_CryptoInfo; -typedef int (*CryptoDevCallbackFunc)(int devId, wc_CryptoInfo* info, void* ctx); +typedef int (*CryptoDevCallbackFunc)(int devId, struct wc_CryptoInfo* info, void* ctx); WOLFSSL_LOCAL void wc_CryptoCb_Init(void); WOLFSSL_LOCAL void wc_CryptoCb_Cleanup(void); diff --git a/wolfssl/wolfcrypt/ecc.h b/wolfssl/wolfcrypt/ecc.h index 04a7a66e9..ae01eaf1d 100644 --- a/wolfssl/wolfcrypt/ecc.h +++ b/wolfssl/wolfcrypt/ecc.h @@ -215,7 +215,7 @@ enum { #if defined(HAVE_ECC) || defined(HAVE_CURVE25519) || \ defined(HAVE_CURVE448) || defined(WOLFCRYPT_HAVE_SAKKE) /* Curve Types */ -typedef enum ecc_curve_id { +enum ecc_curve_ids { ECC_CURVE_INVALID = -1, ECC_CURVE_DEF = 0, /* NIST or SECP */ @@ -272,7 +272,8 @@ typedef enum ecc_curve_id { ECC_CURVE_CUSTOM, #endif ECC_CURVE_MAX -} ecc_curve_id; +}; +typedef enum ecc_curve_ids ecc_curve_id; #endif #ifdef HAVE_ECC diff --git a/wolfssl/wolfcrypt/port/silabs/silabs_ecc.h b/wolfssl/wolfcrypt/port/silabs/silabs_ecc.h index aa4eb7642..1275edc84 100644 --- a/wolfssl/wolfcrypt/port/silabs/silabs_ecc.h +++ b/wolfssl/wolfcrypt/port/silabs/silabs_ecc.h @@ -33,7 +33,6 @@ #include #include -typedef enum ecc_curve_id ecc_curve_id; typedef struct ecc_key ecc_key; int silabs_ecc_sign_hash (const byte* in, word32 inlen, diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index a1c08177f..c189a952b 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -1270,11 +1270,11 @@ #define TIME_OVERRIDES #ifndef XTIME #error "Must define XTIME externally see porting guide" - #error "https://www.wolfssl.com/docs/porting-guide/" + /* https://www.wolfssl.com/docs/porting-guide/ */ #endif #ifndef XGMTIME #error "Must define XGMTIME externally see porting guide" - #error "https://www.wolfssl.com/docs/porting-guide/" + /* https://www.wolfssl.com/docs/porting-guide/ */ #endif #endif @@ -4346,14 +4346,17 @@ extern void uITRON4_free(void *p) ; #ifdef WOLFSSL_HARDEN_TLS #if defined(HAVE_TRUNCATED_HMAC) && !defined(WOLFSSL_HARDEN_TLS_ALLOW_TRUNCATED_HMAC) - #error "Truncated HMAC Extension not allowed https://www.rfc-editor.org/rfc/rfc9325#section-4.6" + #error "Truncated HMAC Extension not allowed" + /* https://www.rfc-editor.org/rfc/rfc9325#section-4.6 */ #endif #if !defined(NO_OLD_TLS) && !defined(WOLFSSL_HARDEN_TLS_ALLOW_OLD_TLS) - #error "TLS < 1.2 protocol versions not allowed https://www.rfc-editor.org/rfc/rfc9325#section-3.1.1" + #error "TLS < 1.2 protocol versions not allowed" + /* https://www.rfc-editor.org/rfc/rfc9325#section-3.1.1 */ #endif #if !defined(WOLFSSL_NO_TLS12) && !defined(HAVE_SECURE_RENEGOTIATION) && \ !defined(HAVE_SERVER_RENEGOTIATION_INFO) && !defined(WOLFSSL_HARDEN_TLS_NO_SCR_CHECK) - #error "TLS 1.2 requires at least HAVE_SERVER_RENEGOTIATION_INFO to send the secure renegotiation extension https://www.rfc-editor.org/rfc/rfc9325#section-3.5" + #error "TLS 1.2 requires at least HAVE_SERVER_RENEGOTIATION_INFO to send the secure renegotiation extension" + /* https://www.rfc-editor.org/rfc/rfc9325#section-3.5 */ #endif #if !defined(WOLFSSL_EXTRA_ALERTS) || !defined(WOLFSSL_CHECK_ALERT_ON_ERR) #error "RFC9325 requires some additional alerts to be sent"