Skip to content

Commit 6188c9c

Browse files
authored
Merge pull request #8563 from douzzer/20250313-various-fixes
20250313-various-fixes
2 parents 37909e9 + b9111aa commit 6188c9c

7 files changed

Lines changed: 32 additions & 7 deletions

File tree

configure.ac

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ AC_CHECK_LIB([network],[socket])
124124
AC_C_BIGENDIAN
125125
AC_C___ATOMIC
126126
AC_CHECK_HEADER(stdatomic.h, [AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSL_HAVE_ATOMIC_H"],[])
127+
AC_CHECK_HEADER(assert.h, [AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSL_HAVE_ASSERT_H"],[])
127128

128129
# check if functions of interest are linkable, but also check if
129130
# they're declared by the expected headers, and if not, supersede the
@@ -1212,6 +1213,16 @@ then
12121213
esac
12131214
fi
12141215

1216+
# 32 bit armasm and RISC-V asm don't yet support WOLFSSL_AESGCM_STREAM. Disable
1217+
# implicit activation, and error on explicit activation.
1218+
if test "$enable_riscv_asm" = "yes" || (test "$enable_armasm" = "yes" && test "$host_cpu" != "aarch64" && test "$host_cpu" != "aarch64_be")
1219+
then
1220+
if test "$enable_aesgcm_stream" = "yes"
1221+
then
1222+
AC_MSG_ERROR([32 bit armasm and RISC-V asm don't yet support WOLFSSL_AESGCM_STREAM.])
1223+
fi
1224+
enable_aesgcm_stream=no
1225+
fi
12151226

12161227
# All wolfCrypt features:
12171228
AC_ARG_ENABLE([all-crypto],
@@ -6058,7 +6069,7 @@ fi
60586069
60596070
# CHACHA
60606071
AC_ARG_ENABLE([chacha],
6061-
[AS_HELP_STRING([--enable-chacha],[Enable CHACHA (default: enabled). Use `=noasm` to disable ASM AVX/AVX2 speedups])],
6072+
[AS_HELP_STRING([--enable-chacha],[Enable CHACHA (default: enabled). Use `=noasm` to disable asm speedups])],
60626073
[ ENABLED_CHACHA=$enableval ],
60636074
[ ENABLED_CHACHA=$CHACHA_DEFAULT]
60646075
)
@@ -9744,7 +9755,12 @@ if test "$ENABLED_AESGCM_STREAM" != "no"
97449755
then
97459756
if test "$ENABLED_AESGCM" = "no"
97469757
then
9747-
AC_MSG_ERROR([AES-GCM streaming enabled but AES-GCM is disabled])
9758+
AC_MSG_ERROR([AES-GCM streaming is enabled but AES-GCM is disabled.])
9759+
elif test "$ENABLED_RISCV_ASM" = "yes" || \
9760+
(test "$ENABLED_ARMASM" = "yes" && \
9761+
test "$host_cpu" != "aarch64" && test "$host_cpu" != "aarch64_be")
9762+
then
9763+
AC_MSG_ERROR([32 bit armasm and RISC-V asm don't yet support WOLFSSL_AESGCM_STREAM.])
97489764
else
97499765
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AESGCM_STREAM"
97509766
AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_AESGCM_STREAM"
@@ -10156,6 +10172,7 @@ AM_CONDITIONAL([BUILD_SHA224],[test "x$ENABLED_SHA224" = "xyes" || test "x$ENABL
1015610172
AM_CONDITIONAL([BUILD_SHA3],[test "x$ENABLED_SHA3" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"])
1015710173
AM_CONDITIONAL([BUILD_POLY1305],[test "x$ENABLED_POLY1305" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
1015810174
AM_CONDITIONAL([BUILD_CHACHA],[test "x$ENABLED_CHACHA" = "xyes" || test "x$ENABLED_CHACHA" = "xnoasm" || test "x$ENABLED_USERSETTINGS" = "xyes"])
10175+
AM_CONDITIONAL([BUILD_CHACHA_NOASM],[test "$ENABLED_CHACHA" = "noasm"])
1015910176
AM_CONDITIONAL([BUILD_XCHACHA],[test "x$ENABLED_XCHACHA" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
1016010177
AM_CONDITIONAL([BUILD_ASCON],[test "x$ENABLED_ASCON" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
1016110178
AM_CONDITIONAL([BUILD_SM2],[test "x$ENABLED_SM2" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"])

src/include.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,7 @@ endif
11271127

11281128
if BUILD_CHACHA
11291129
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/chacha.c
1130+
if !BUILD_CHACHA_NOASM
11301131
if BUILD_ARMASM
11311132
if BUILD_ARM_NONTHUMB
11321133
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/port/arm/armv8-chacha.c
@@ -1159,6 +1160,7 @@ src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/chacha_asm.S
11591160
endif BUILD_INTELASM
11601161
endif !BUILD_X86_ASM
11611162
endif !BUILD_ARMASM
1163+
endif !BUILD_CHACHA_NOASM
11621164
if BUILD_POLY1305
11631165
src_libwolfssl@LIBSUFFIX@_la_SOURCES += wolfcrypt/src/chacha20_poly1305.c
11641166
endif BUILD_POLY1305

tests/api.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86346,7 +86346,8 @@ static int test_TLSX_CA_NAMES_bad_extension(void)
8634686346
#if defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) && defined(WOLFSSL_TLS13) && \
8634786347
!defined(NO_CERTS) && !defined(WOLFSSL_NO_CA_NAMES) && \
8634886348
defined(OPENSSL_EXTRA) && defined(WOLFSSL_SHA384) && \
86349-
defined(HAVE_NULL_CIPHER)
86349+
defined(HAVE_NULL_CIPHER) && defined(HAVE_CHACHA) && \
86350+
defined(HAVE_POLY1305)
8635086351
/* This test should only fail (with BUFFER_ERROR) when we actually try to
8635186352
* parse the CA Names extension. Otherwise it will return other non-related
8635286353
* errors. If CA Names will be parsed in more configurations, that should

wolfcrypt/src/aes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6473,7 +6473,7 @@ static WC_INLINE void IncCtr(byte* ctr, word32 ctrSz)
64736473
#endif
64746474

64756475
#if defined(WOLFSSL_ARMASM) && !defined(__aarch64__)
6476-
/* implemented in wolfcrypt/src/port/arm/rmv8-aes.c */
6476+
/* implemented in wolfcrypt/src/port/arm/armv8-aes.c */
64776477

64786478
#elif defined(WOLFSSL_RISCV_ASM)
64796479
/* implemented in wolfcrypt/src/port/risc-v/riscv-64-aes.c */
@@ -10874,7 +10874,7 @@ int wc_AesCcmCheckTagSize(int sz)
1087410874
}
1087510875

1087610876
#if defined(WOLFSSL_ARMASM) && !defined(__aarch64__)
10877-
/* implemented in wolfcrypt/src/port/arm/rmv8-aes.c */
10877+
/* implemented in wolfcrypt/src/port/arm/armv8-aes.c */
1087810878

1087910879
#elif defined(WOLFSSL_RISCV_ASM)
1088010880
/* implementation located in wolfcrypt/src/port/risc-v/riscv-64-aes.c */

wolfcrypt/src/chacha.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ Public domain.
7272
#endif /* HAVE_CHACHA */
7373

7474

75-
#if defined(WOLFSSL_ARMASM)
75+
#if defined(WOLFSSL_ARMASM) && !defined(NO_CHACHA_ASM)
7676
/* implementation is located in wolfcrypt/src/port/arm/armv8-chacha.c */
7777

78-
#elif defined(WOLFSSL_RISCV_ASM)
78+
#elif defined(WOLFSSL_RISCV_ASM) && !defined(NO_CHACHA_ASM)
7979
/* implementation located in wolfcrypt/src/port/riscv/riscv-64-chacha.c */
8080

8181
#else

wolfssl/wolfcrypt/settings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3611,6 +3611,8 @@ extern void uITRON4_free(void *p) ;
36113611
#undef HAVE_ATEXIT
36123612
#undef WOLFSSL_HAVE_MIN
36133613
#undef WOLFSSL_HAVE_MAX
3614+
#undef WOLFSSL_HAVE_ASSERT_H
3615+
#define WOLFSSL_NO_ASSERT_H
36143616
#define SIZEOF_LONG 8
36153617
#define SIZEOF_LONG_LONG 8
36163618
#define CHAR_BIT 8

wolfssl/wolfcrypt/types.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,6 +1808,9 @@ typedef struct w64wrapper {
18081808
#define wc_static_assert(expr) struct wc_static_assert_dummy_struct
18091809
#define wc_static_assert2(expr, msg) wc_static_assert(expr)
18101810
#elif !defined(wc_static_assert)
1811+
#if defined(WOLFSSL_HAVE_ASSERT_H) && !defined(WOLFSSL_NO_ASSERT_H)
1812+
#include <assert.h>
1813+
#endif
18111814
#if (defined(__cplusplus) && (__cplusplus >= 201703L)) || \
18121815
(defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 202311L)) || \
18131816
(defined(_MSVC_LANG) && (__cpp_static_assert >= 201411L))

0 commit comments

Comments
 (0)