Skip to content

Commit 3da72fb

Browse files
authored
Merge branch 'wolfSSL:master' into tropic01-dev
2 parents abdcf4d + 05ff129 commit 3da72fb

23 files changed

Lines changed: 819 additions & 330 deletions

.github/workflows/nginx.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,28 @@ jobs:
122122

123123
- name: Install dependencies
124124
run: |
125-
sudo cpan -iT Proc::Find Net::SSLeay IO::Socket::SSL
125+
sudo cpan -iT Proc::Find
126+
127+
# Locking in the version of SSLeay used with testing
128+
- name: Download and install Net::SSLeay 1.94 manually
129+
run: |
130+
curl -LO https://www.cpan.org/modules/by-module/Net/CHRISN/Net-SSLeay-1.94.tar.gz
131+
tar -xzf Net-SSLeay-1.94.tar.gz
132+
cd Net-SSLeay-1.94
133+
perl Makefile.PL
134+
make
135+
sudo make install
136+
137+
# SSL version 2.091 changes '' return to undef causing test case to fail.
138+
# Locking in the test version to use as 2.090
139+
- name: Download and install IO::Socket::SSL 2.090 manually
140+
run: |
141+
curl -LO https://www.cpan.org/modules/by-module/IO/IO-Socket-SSL-2.090.tar.gz
142+
tar -xzf IO-Socket-SSL-2.090.tar.gz
143+
cd IO-Socket-SSL-2.090
144+
perl Makefile.PL
145+
make
146+
sudo make install
126147
127148
- name: Checkout wolfssl-nginx
128149
uses: actions/checkout@v4

.github/workflows/os-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ jobs:
4848
'--enable-sniffer --enable-curve25519 --enable-curve448 --enable-enckeys CFLAGS=-DWOLFSSL_DH_EXTRA',
4949
'--enable-dtls --enable-dtls13 --enable-dtls-frag-ch
5050
--enable-dtls-mtu CPPFLAGS=-DWOLFSSL_DTLS_RECORDS_CAN_SPAN_DATAGRAMS',
51+
'--enable-opensslall --enable-opensslextra CPPFLAGS=-DWC_RNG_SEED_CB',
52+
'--enable-opensslall --enable-opensslextra
53+
CPPFLAGS=''-DWC_RNG_SEED_CB -DWOLFSSL_NO_GETPID'' ',
5154
]
5255
name: make check
5356
if: github.repository_owner == 'wolfssl'

.wolfssl_known_macro_extras

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ LIBWOLFSSL_VERSION_GIT_HASH_DATE
294294
LIBWOLFSSL_VERSION_GIT_ORIGIN
295295
LIBWOLFSSL_VERSION_GIT_SHORT_HASH
296296
LIBWOLFSSL_VERSION_GIT_TAG
297+
LINUXKM_DONT_FORCE_FIPS_ENABLED
297298
LINUXKM_FPU_STATES_FOLLOW_THREADS
298299
LINUXKM_LKCAPI_PRIORITY_ALLOW_MASKING
299300
LINUX_CYCLE_COUNT

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ check_function_exists("memset" HAVE_MEMSET)
124124
check_function_exists("socket" HAVE_SOCKET)
125125
check_function_exists("strftime" HAVE_STRFTIME)
126126
check_function_exists("__atomic_fetch_add" HAVE_C___ATOMIC)
127+
check_function_exists("getpid" HAVE_GETPID)
127128

128129
include(CheckSymbolExists)
129130
check_symbol_exists(isascii "ctype.h" HAVE_ISASCII)

configure.ac

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ AC_CHECK_HEADER(assert.h, [AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSL_HAVE_ASSERT_H"],[
129129
# check if functions of interest are linkable, but also check if
130130
# they're declared by the expected headers, and if not, supersede the
131131
# unusable positive from AC_CHECK_FUNCS().
132-
AC_CHECK_FUNCS([gethostbyname getaddrinfo gettimeofday gmtime_r gmtime_s inet_ntoa memset socket strftime atexit isascii])
133-
AC_CHECK_DECLS([gethostbyname, getaddrinfo, gettimeofday, gmtime_r, gmtime_s, inet_ntoa, memset, socket, strftime, atexit, isascii], [], [
132+
AC_CHECK_FUNCS([gethostbyname getaddrinfo gettimeofday gmtime_r gmtime_s inet_ntoa memset socket strftime atexit isascii getpid])
133+
AC_CHECK_DECLS([gethostbyname, getaddrinfo, gettimeofday, gmtime_r, gmtime_s, inet_ntoa, memset, socket, strftime, atexit, isascii, getpid], [], [
134134
if test "$(eval echo \$"$(eval 'echo ac_cv_func_${as_decl_name}')")" = "yes"
135135
then
136136
AC_MSG_NOTICE([ note: earlier check for $(eval 'echo ${as_decl_name}') superseded.])
@@ -3261,6 +3261,26 @@ then
32613261
ENABLED_ARMASM_CRYPTO_SM4=yes
32623262
ENABLED_ARMASM_PLUS=yes
32633263
;;
3264+
barrier-sb)
3265+
case $host_cpu in
3266+
*aarch64*)
3267+
;;
3268+
*)
3269+
AC_MSG_ERROR([SB instructions only available on Aarch64 v8.5+ CPU.])
3270+
break;;
3271+
esac
3272+
ENABLED_ARMASM_BARRIER_SB=yes
3273+
;;
3274+
barrier-detect)
3275+
case $host_cpu in
3276+
*aarch64*)
3277+
;;
3278+
*)
3279+
AC_MSG_ERROR([SB instructions only available on Aarch64 v8.5+ CPU.])
3280+
break;;
3281+
esac
3282+
ENABLED_ARMASM_BARRIER_DETECT=yes
3283+
;;
32643284
*)
32653285
AC_MSG_ERROR([Invalid choice of ARM asm inclusions (yes, sha512-crypto, sha3-crypto): $ENABLED_ARMASM.])
32663286
break;;
@@ -3403,6 +3423,12 @@ fi
34033423
if test "$ENABLED_ARMASM_SM4" = "yes"; then
34043424
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ARMASM_CRYPTO_SM4"
34053425
fi
3426+
if test "$ENABLED_ARMASM_BARRIER_SB" = "yes"; then
3427+
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ARMASM_BARRIER_SB"
3428+
fi
3429+
if test "$ENABLED_ARMASM_BARRIER_DETECT" = "yes"; then
3430+
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ARMASM_BARRIER_DETECT"
3431+
fi
34063432
if test "$ENABLED_ARMASM_CRYPTO" = "unknown"; then
34073433
ENABLED_ARMASM_CRYPTO=no
34083434
fi
@@ -7214,10 +7240,16 @@ then
72147240
fi
72157241
72167242
# Small Stack - Cache on object
7243+
if test "$ENABLED_LINUXKM_DEFAULTS" = "yes"
7244+
then
7245+
ENABLED_SMALL_STACK_CACHE_DEFAULT=yes
7246+
else
7247+
ENABLED_SMALL_STACK_CACHE_DEFAULT=no
7248+
fi
72177249
AC_ARG_ENABLE([smallstackcache],
72187250
[AS_HELP_STRING([--enable-smallstackcache],[Enable Small Stack Usage Caching (default: disabled)])],
72197251
[ ENABLED_SMALL_STACK_CACHE=$enableval ],
7220-
[ ENABLED_SMALL_STACK_CACHE=no ]
7252+
[ ENABLED_SMALL_STACK_CACHE=$ENABLED_SMALL_STACK_CACHE_DEFAULT ]
72217253
)
72227254
72237255
if test "x$ENABLED_SMALL_STACK_CACHE" = "xyes"

linuxkm/lkcapi_ecdh_glue.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -885,12 +885,23 @@ static int linuxkm_test_ecdh_nist_driver(const char * driver,
885885
*/
886886
tfm = crypto_alloc_kpp(driver, 0, 0);
887887
if (IS_ERR(tfm)) {
888-
pr_err("error: allocating kpp algorithm %s failed: %ld\n",
889-
driver, PTR_ERR(tfm));
890-
if (PTR_ERR(tfm) == -ENOMEM)
891-
test_rc = MEMORY_E;
888+
#if defined(HAVE_FIPS) && defined(CONFIG_CRYPTO_MANAGER) && \
889+
!defined(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS)
890+
if ((PTR_ERR(tfm) == -ENOENT) && fips_enabled) {
891+
pr_info("info: skipping unsupported kpp algorithm %s: %ld\n",
892+
driver, PTR_ERR(tfm));
893+
test_rc = NOT_COMPILED_IN;
894+
}
892895
else
893-
test_rc = BAD_FUNC_ARG;
896+
#endif
897+
{
898+
pr_err("error: allocating kpp algorithm %s failed: %ld\n",
899+
driver, PTR_ERR(tfm));
900+
if (PTR_ERR(tfm) == -ENOMEM)
901+
test_rc = MEMORY_E;
902+
else
903+
test_rc = BAD_FUNC_ARG;
904+
}
894905
tfm = NULL;
895906
goto test_ecdh_nist_end;
896907
}

linuxkm/lkcapi_ecdsa_glue.c

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -727,12 +727,27 @@ static int linuxkm_test_ecdsa_nist_driver(const char * driver,
727727
*/
728728
tfm = crypto_alloc_akcipher(driver, 0, 0);
729729
if (IS_ERR(tfm)) {
730-
pr_err("error: allocating akcipher algorithm %s failed: %ld\n",
731-
driver, PTR_ERR(tfm));
732-
if (PTR_ERR(tfm) == -ENOMEM)
733-
test_rc = MEMORY_E;
730+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 3, 0)) && \
731+
defined(HAVE_FIPS) && defined(CONFIG_CRYPTO_MANAGER) && \
732+
!defined(CONFIG_CRYPTO_MANAGER_DISABLE_TESTS)
733+
/* ecdsa was not recognized as fips_allowed before linux v6.3
734+
* in kernel crypto/testmgr.c, and the kernel will block
735+
* its allocation if fips_enabled is set. */
736+
if ((PTR_ERR(tfm) == -ENOENT) && fips_enabled) {
737+
pr_info("info: skipping unsupported akcipher algorithm %s: %ld\n",
738+
driver, PTR_ERR(tfm));
739+
test_rc = NOT_COMPILED_IN;
740+
}
734741
else
735-
test_rc = BAD_FUNC_ARG;
742+
#endif
743+
{
744+
pr_err("error: allocating akcipher algorithm %s failed: %ld\n",
745+
driver, PTR_ERR(tfm));
746+
if (PTR_ERR(tfm) == -ENOMEM)
747+
test_rc = MEMORY_E;
748+
else
749+
test_rc = BAD_FUNC_ARG;
750+
}
736751
tfm = NULL;
737752
goto test_ecdsa_nist_end;
738753
}

0 commit comments

Comments
 (0)