Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .wolfssl_known_macro_extras
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,7 @@ __SDCC_VERSION_MINOR
__SDCC_VERSION_PATCH
__SIZEOF_INT128__
__SIZEOF_LONG_LONG__
__STDC_NO_ATOMICS__
__STDC_VERSION__
__STDC__
__STM32__
Expand Down Expand Up @@ -1042,4 +1043,3 @@ ssize_t
sun
versal
wc_Tls13_HKDF_Expand_Label
__STDC_NO_ATOMICS__
2 changes: 1 addition & 1 deletion scripts/openssl.test
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ check_server_ready() {
server_ready=0
while [ "$counter" -lt 20 ]; do
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=$?
if [ $nc_result = 0 ]
then
Expand Down
4 changes: 2 additions & 2 deletions wolfcrypt/benchmark/benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -3136,7 +3136,7 @@ static void* benchmarks_do(void* args)
}

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);
goto exit;
}
Expand Down Expand Up @@ -3182,7 +3182,7 @@ static void* benchmarks_do(void* args)
}

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);
goto exit;
}
Expand Down
11 changes: 6 additions & 5 deletions wolfssl/wolfcrypt/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#if defined(WOLFSSL_SHA384) || defined(WOLFSSL_SHA512)
#include <wolfssl/wolfcrypt/sha512.h>
#endif
#ifdef HAVE_BLAKE2
#if defined(HAVE_BLAKE2) || defined(HAVE_BLAKE2S)
#include <wolfssl/wolfcrypt/blake2.h>
#endif
#ifdef WOLFSSL_SHA3
Expand All @@ -52,9 +52,6 @@
#ifdef WOLFSSL_MD2
#include <wolfssl/wolfcrypt/md2.h>
#endif
#if defined(HAVE_BLAKE2) || defined(HAVE_BLAKE2S)
#include <wolfssl/wolfcrypt/blake2.h>
#endif
#ifdef WOLFSSL_SM3
#include <wolfssl/wolfcrypt/sm3.h>
#endif
Expand Down Expand Up @@ -122,11 +119,15 @@ typedef struct {
} wc_HashAlg;
#endif /* !NO_HASH_WRAPPER */


/* Find largest possible digest size
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)
/* note: SHA3-224 has the largest block 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)
#define WC_MAX_DIGEST_SIZE WC_SHA512_DIGEST_SIZE
#define WC_MAX_BLOCK_SIZE WC_SHA512_BLOCK_SIZE
Expand Down
10 changes: 7 additions & 3 deletions wolfssl/wolfcrypt/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -2063,10 +2063,14 @@ enum Max_ASN {
#endif
};

#ifndef WC_MAX_DIGEST_SIZE
#define WC_MAX_DIGEST_SIZE 64
#endif
#ifndef WC_MAX_DIGEST_SIZE
#define WC_MAX_BLOCK_SIZE 128
#endif

#ifdef WOLFSSL_CERT_GEN
#ifdef WOLFSSL_NO_MALLOC
#include "wolfssl/wolfcrypt/hash.h" /* for max sizes */
#endif
/* Used in asn.c MakeSignature for ECC and RSA non-blocking/async */
enum CertSignState {
CERTSIGN_STATE_BEGIN,
Expand Down