Skip to content

Commit 407a125

Browse files
Merge pull request #8851 from douzzer/20250606-fixes
Adjustment for warnings with NO_TLS build and add github actions test
2 parents 3ecc58c + efc3665 commit 407a125

5 files changed

Lines changed: 71 additions & 4 deletions

File tree

.github/workflows/no-tls.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: --disable-tls Tests
2+
3+
# START OF COMMON SECTION
4+
on:
5+
push:
6+
branches: [ 'master', 'main', 'release/**' ]
7+
pull_request:
8+
branches: [ '*' ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
# END OF COMMON SECTION
14+
15+
jobs:
16+
make_check:
17+
strategy:
18+
matrix:
19+
config: [
20+
# Add new configs here
21+
'--disable-tls --enable-all CFLAGS="-pedantic -Wdeclaration-after-statement -DTEST_LIBWOLFSSL_SOURCES_INCLUSION_SEQUENCE"',
22+
]
23+
name: make check
24+
if: github.repository_owner == 'wolfssl'
25+
runs-on: ubuntu-22.04
26+
# This should be a safe limit for the tests to run.
27+
timeout-minutes: 6
28+
steps:
29+
- uses: actions/checkout@v4
30+
name: Checkout wolfSSL
31+
32+
- name: Test wolfSSL
33+
run: |
34+
./autogen.sh
35+
./configure ${{ matrix.config }}
36+
make -j 4
37+
make check
38+
39+
- name: Print errors
40+
if: ${{ failure() }}
41+
run: |
42+
for file in scripts/*.log
43+
do
44+
if [ -f "$file" ]; then
45+
echo "${file}:"
46+
cat "$file"
47+
echo "========================================================================"
48+
fi
49+
done

.github/workflows/pq-all.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
config: [
2020
# Add new configs here
2121
'--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"',
22+
'--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"',
2223
'--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++'
2324
]
2425
name: make check

src/internal.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27090,6 +27090,7 @@ void SetErrorString(int error, char* str)
2709027090
#endif
2709127091
#endif /* NO_CIPHER_SUITE_ALIASES */
2709227092

27093+
#ifndef NO_TLS
2709327094
static const CipherSuiteInfo cipher_names[] =
2709427095
{
2709527096

@@ -27569,6 +27570,14 @@ static const CipherSuiteInfo cipher_names[] =
2756927570
#endif /* WOLFSSL_NO_TLS12 */
2757027571
};
2757127572

27573+
#else /* NO_TLS */
27574+
27575+
static const CipherSuiteInfo cipher_names[] =
27576+
{
27577+
SUITE_INFO("NO-TLS","NO-TLS", 0, 0, 0, 0),
27578+
};
27579+
27580+
#endif /* NO_TLS */
2757227581

2757327582
/* returns the cipher_names array */
2757427583
const CipherSuiteInfo* GetCipherNames(void)
@@ -27580,7 +27589,11 @@ const CipherSuiteInfo* GetCipherNames(void)
2758027589
/* returns the number of elements in the cipher_names array */
2758127590
int GetCipherNamesSize(void)
2758227591
{
27592+
#ifdef NO_TLS
27593+
return 0;
27594+
#else
2758327595
return (int)(sizeof(cipher_names) / sizeof(CipherSuiteInfo));
27596+
#endif
2758427597
}
2758527598

2758627599

tests/api/test_x509.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
#include <wolfssl/openssl/x509.h>
3737
#include <wolfssl/openssl/x509v3.h>
3838

39-
#if defined(OPENSSL_ALL)
39+
#if defined(OPENSSL_ALL) && \
40+
defined(HAVE_MANUAL_MEMIO_TESTS_DEPENDENCIES)
4041
#define HAVE_TEST_X509_RFC2818_VERIFICATION_CALLBACK
4142
/* callback taken and simplified from
4243
* include/boost/asio/ssl/impl/rfc2818_verification.ipp

wolfcrypt/test/test.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47885,9 +47885,6 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t lms_test(void)
4788547885
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC)
4788647886
byte * sig = (byte*)XMALLOC(WC_TEST_LMS_SIG_LEN, HEAP_HINT,
4788747887
DYNAMIC_TYPE_TMP_BUFFER);
47888-
if (sig == NULL) {
47889-
return WC_TEST_RET_ENC_ERRNO;
47890-
}
4789147888
#else
4789247889
byte sig[WC_TEST_LMS_SIG_LEN];
4789347890
#endif
@@ -47898,6 +47895,12 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t lms_test(void)
4789847895

4789947896
WOLFSSL_ENTER("lms_test");
4790047897

47898+
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC)
47899+
if (sig == NULL) {
47900+
return WC_TEST_RET_ENC_ERRNO;
47901+
}
47902+
#endif
47903+
4790147904
XMEMSET(priv, 0, sizeof(priv));
4790247905
XMEMSET(old_priv, 0, sizeof(old_priv));
4790347906
XMEMSET(sig, 0, WC_TEST_LMS_SIG_LEN);

0 commit comments

Comments
 (0)