Fixes issue with cert gen, no malloc and crypto callback causing wolfssl/wolfcrypt/asn.h:1375:18: error: use of undeclared identifier 'WC_MAX_DIGEST_SIZE. Fixed netcat issue in openssl.test causing server open check to fail on some platforms. Fixed clang-tidy report in benchmark.c where XFTELL could return negative (error) and wasn't handled.

This commit is contained in:
David Garske
2025-06-20 16:24:48 -07:00
parent 1be303866e
commit b9455bc94b
5 changed files with 17 additions and 12 deletions

View File

@ -987,6 +987,7 @@ __SDCC_VERSION_MINOR
__SDCC_VERSION_PATCH __SDCC_VERSION_PATCH
__SIZEOF_INT128__ __SIZEOF_INT128__
__SIZEOF_LONG_LONG__ __SIZEOF_LONG_LONG__
__STDC_NO_ATOMICS__
__STDC_VERSION__ __STDC_VERSION__
__STDC__ __STDC__
__STM32__ __STM32__
@ -1042,4 +1043,3 @@ ssize_t
sun sun
versal versal
wc_Tls13_HKDF_Expand_Label wc_Tls13_HKDF_Expand_Label
__STDC_NO_ATOMICS__

View File

@ -280,7 +280,7 @@ check_server_ready() {
server_ready=0 server_ready=0
while [ "$counter" -lt 20 ]; do while [ "$counter" -lt 20 ]; do
echo -e "waiting for $server_name ready..." echo -e "waiting for $server_name ready..."
echo -e Checking | nc -w 5 localhost $server_port echo -e Checking | nc -4 -w 1 -z localhost $server_port
nc_result=$? nc_result=$?
if [ $nc_result = 0 ] if [ $nc_result = 0 ]
then then

View File

@ -3136,7 +3136,7 @@ static void* benchmarks_do(void* args)
} }
bench_buf_size = XFTELL(file); bench_buf_size = XFTELL(file);
if(XFSEEK(file, 0, XSEEK_SET) != 0) { if(bench_buf_size < 0 || XFSEEK(file, 0, XSEEK_SET) != 0) {
XFCLOSE(file); XFCLOSE(file);
goto exit; goto exit;
} }
@ -3182,7 +3182,7 @@ static void* benchmarks_do(void* args)
} }
bench_buf_size = XFTELL(file); bench_buf_size = XFTELL(file);
if(XFSEEK(file, 0, XSEEK_SET) != 0) { if (bench_buf_size < 0 || XFSEEK(file, 0, XSEEK_SET) != 0) {
XFCLOSE(file); XFCLOSE(file);
goto exit; goto exit;
} }

View File

@ -40,7 +40,7 @@
#if defined(WOLFSSL_SHA384) || defined(WOLFSSL_SHA512) #if defined(WOLFSSL_SHA384) || defined(WOLFSSL_SHA512)
#include <wolfssl/wolfcrypt/sha512.h> #include <wolfssl/wolfcrypt/sha512.h>
#endif #endif
#ifdef HAVE_BLAKE2 #if defined(HAVE_BLAKE2) || defined(HAVE_BLAKE2S)
#include <wolfssl/wolfcrypt/blake2.h> #include <wolfssl/wolfcrypt/blake2.h>
#endif #endif
#ifdef WOLFSSL_SHA3 #ifdef WOLFSSL_SHA3
@ -52,9 +52,6 @@
#ifdef WOLFSSL_MD2 #ifdef WOLFSSL_MD2
#include <wolfssl/wolfcrypt/md2.h> #include <wolfssl/wolfcrypt/md2.h>
#endif #endif
#if defined(HAVE_BLAKE2) || defined(HAVE_BLAKE2S)
#include <wolfssl/wolfcrypt/blake2.h>
#endif
#ifdef WOLFSSL_SM3 #ifdef WOLFSSL_SM3
#include <wolfssl/wolfcrypt/sm3.h> #include <wolfssl/wolfcrypt/sm3.h>
#endif #endif
@ -122,11 +119,15 @@ typedef struct {
} wc_HashAlg; } wc_HashAlg;
#endif /* !NO_HASH_WRAPPER */ #endif /* !NO_HASH_WRAPPER */
/* Find largest possible digest size /* Find largest possible digest size
Note if this gets up to the size of 80 or over check smallstack build */ Note if this gets up to the size of 80 or over check smallstack build */
#undef WC_MAX_DIGEST_SIZE
#undef WC_MAX_BLOCK_SIZE
#if defined(WOLFSSL_SHA3) #if defined(WOLFSSL_SHA3)
/* note: SHA3-224 has the largest block size */
#define WC_MAX_DIGEST_SIZE WC_SHA3_512_DIGEST_SIZE #define WC_MAX_DIGEST_SIZE WC_SHA3_512_DIGEST_SIZE
#define WC_MAX_BLOCK_SIZE WC_SHA3_224_BLOCK_SIZE /* 224 is the largest block size */ #define WC_MAX_BLOCK_SIZE WC_SHA3_224_BLOCK_SIZE
#elif defined(WOLFSSL_SHA512) #elif defined(WOLFSSL_SHA512)
#define WC_MAX_DIGEST_SIZE WC_SHA512_DIGEST_SIZE #define WC_MAX_DIGEST_SIZE WC_SHA512_DIGEST_SIZE
#define WC_MAX_BLOCK_SIZE WC_SHA512_BLOCK_SIZE #define WC_MAX_BLOCK_SIZE WC_SHA512_BLOCK_SIZE

View File

@ -2063,10 +2063,14 @@ enum Max_ASN {
#endif #endif
}; };
#ifdef WOLFSSL_CERT_GEN #ifndef WC_MAX_DIGEST_SIZE
#ifdef WOLFSSL_NO_MALLOC #define WC_MAX_DIGEST_SIZE 64
#include "wolfssl/wolfcrypt/hash.h" /* for max sizes */
#endif #endif
#ifndef WC_MAX_DIGEST_SIZE
#define WC_MAX_BLOCK_SIZE 128
#endif
#ifdef WOLFSSL_CERT_GEN
/* Used in asn.c MakeSignature for ECC and RSA non-blocking/async */ /* Used in asn.c MakeSignature for ECC and RSA non-blocking/async */
enum CertSignState { enum CertSignState {
CERTSIGN_STATE_BEGIN, CERTSIGN_STATE_BEGIN,