From 4572dcf9f9a1f40f788c83af8fa7eafaa4292a0a Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Fri, 6 Jun 2025 17:18:50 +0400 Subject: [PATCH] tests/api/test_x509.c: in test_x509_rfc2818_verification_callback(), add dependency on HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES; wolfcrypt/test/test.c: in lms_test(), fix -Wdeclaration-after-statement; add .github/workflows/no-tls.yml; .github/workflows/pq-all.yml: add smallstack scenario. --- .github/workflows/no-tls.yml | 49 ++++++++++++++++++++++++++++++++++++ .github/workflows/pq-all.yml | 1 + tests/api/test_x509.c | 3 ++- wolfcrypt/test/test.c | 9 ++++--- 4 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/no-tls.yml diff --git a/.github/workflows/no-tls.yml b/.github/workflows/no-tls.yml new file mode 100644 index 000000000..5fd4004b8 --- /dev/null +++ b/.github/workflows/no-tls.yml @@ -0,0 +1,49 @@ +name: --disable-tls Tests + +# START OF COMMON SECTION +on: + push: + branches: [ 'master', 'main', 'release/**' ] + pull_request: + branches: [ '*' ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +# END OF COMMON SECTION + +jobs: + make_check: + strategy: + matrix: + config: [ + # Add new configs here + '--disable-tls --enable-all CFLAGS="-pedantic -Wdeclaration-after-statement -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE"', + ] + name: make check + if: github.repository_owner == 'wolfssl' + runs-on: ubuntu-22.04 + # This should be a safe limit for the tests to run. + timeout-minutes: 6 + steps: + - uses: actions/checkout@v4 + name: Checkout wolfSSL + + - name: Test wolfSSL + run: | + ./autogen.sh + ./configure ${{ matrix.config }} + make -j 4 + make check + + - name: Print errors + if: ${{ failure() }} + run: | + for file in scripts/*.log + do + if [ -f "$file" ]; then + echo "${file}:" + cat "$file" + echo "========================================================================" + fi + done diff --git a/.github/workflows/pq-all.yml b/.github/workflows/pq-all.yml index 233a802e0..4a9d31c37 100644 --- a/.github/workflows/pq-all.yml +++ b/.github/workflows/pq-all.yml @@ -19,6 +19,7 @@ jobs: config: [ # Add new configs here '--enable-intelasm --enable-sp-asm --enable-all --enable-testcert --enable-acert --enable-dtls13 --enable-dtls-mtu --enable-dtls-frag-ch --enable-dtlscid --enable-quic --with-sys-crypto-policy --enable-experimental --enable-kyber=yes,original --enable-lms --enable-xmss --enable-dilithium --enable-dual-alg-certs --disable-qt CPPFLAGS="-pedantic -Wdeclaration-after-statement -DWOLFCRYPT_TEST_LINT -DNO_WOLFSSL_CIPHER_SUITE_TEST -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE"', + '--enable-smallstack --enable-smallstackcache --enable-intelasm --enable-sp-asm --enable-all --enable-testcert --enable-acert --enable-dtls13 --enable-dtls-mtu --enable-dtls-frag-ch --enable-dtlscid --enable-quic --with-sys-crypto-policy --enable-experimental --enable-kyber=yes,original --enable-lms --enable-xmss --enable-dilithium --enable-dual-alg-certs --disable-qt CPPFLAGS="-pedantic -Wdeclaration-after-statement -DWOLFCRYPT_TEST_LINT -DNO_WOLFSSL_CIPHER_SUITE_TEST -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE"', '--enable-intelasm --enable-sp-asm --enable-all --enable-testcert --enable-acert --enable-dtls13 --enable-dtls-mtu --enable-dtls-frag-ch --enable-dtlscid --enable-quic --with-sys-crypto-policy --enable-experimental --enable-kyber=yes,original --enable-lms --enable-xmss --enable-dilithium --enable-dual-alg-certs --disable-qt CPPFLAGS="-pedantic -Wdeclaration-after-statement -DWOLFCRYPT_TEST_LINT -DNO_WOLFSSL_CIPHER_SUITE_TEST -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE" CC=c++' ] name: make check diff --git a/tests/api/test_x509.c b/tests/api/test_x509.c index 58073c47e..319ef8c07 100644 --- a/tests/api/test_x509.c +++ b/tests/api/test_x509.c @@ -36,7 +36,8 @@ #include #include -#if defined(OPENSSL_ALL) +#if defined(OPENSSL_ALL) && \ + defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES) #define HAVE_TEST_X509_RFC2818_VERIFICATION_CALLBACK /* callback taken and simplified from * include/boost/asio/ssl/impl/rfc2818_verification.ipp diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index a2382718f..5c74cf0d1 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -47885,9 +47885,6 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t lms_test(void) #if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC) byte * sig = (byte*)XMALLOC(WC_TEST_LMS_SIG_LEN, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER); - if (sig == NULL) { - return WC_TEST_RET_ENC_ERRNO; - } #else byte sig[WC_TEST_LMS_SIG_LEN]; #endif @@ -47898,6 +47895,12 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t lms_test(void) WOLFSSL_ENTER("lms_test"); +#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC) + if (sig == NULL) { + return WC_TEST_RET_ENC_ERRNO; + } +#endif + XMEMSET(priv, 0, sizeof(priv)); XMEMSET(old_priv, 0, sizeof(old_priv)); XMEMSET(sig, 0, WC_TEST_LMS_SIG_LEN);