Skip to content

Fix undefined variable tls1 in InitSuites for PSK cipher suite#9925

Open
sameehj wants to merge 1 commit intowolfSSL:masterfrom
sameehj:fix-compilation
Open

Fix undefined variable tls1 in InitSuites for PSK cipher suite#9925
sameehj wants to merge 1 commit intowolfSSL:masterfrom
sameehj:fix-compilation

Conversation

@sameehj
Copy link
Contributor

@sameehj sameehj commented Mar 9, 2026

Description

Fix undefined variable tls1 in InitSuites() for the BUILD_TLS_PSK_WITH_AES_128_CBC_SHA256 cipher suite.

The WOLFSSL_OLDTLS_SHA2_CIPHERSUITES #else branch at src/internal.c:4253 referenced an undeclared variable tls1 instead of tls — a copy-paste typo from commit a975ba9 (2019-07-18). This caused a compilation failure when both WOLFSSL_STATIC_PSK and WOLFSSL_OLDTLS_SHA2_CIPHERSUITES were defined. In the default build the buggy line was dead code with no impact.

Also adds a CI matrix entry in .github/workflows/psk.yml to build with WOLFSSL_OLDTLS_SHA2_CIPHERSUITES enabled to prevent regressions.

Testing

  • Configured with ./configure --enable-psk CFLAGS="-DWOLFSSL_STATIC_PSK -DWOLFSSL_OLDTLS_SHA2_CIPHERSUITES"
  • Verified compilation fails before the fix and succeeds after
  • Confirmed the fix is consistent with all other WOLFSSL_OLDTLS_SHA2_CIPHERSUITES else-branches in InitSuites()

Checklist

  • added tests (CI config in .github/workflows/psk.yml)
  • updated/added doxygen (N/A — no API change)
  • updated appropriate READMEs (N/A)
  • Updated manual and documentation (N/A)

The WOLFSSL_OLDTLS_SHA2_CIPHERSUITES else-branch for
BUILD_TLS_PSK_WITH_AES_128_CBC_SHA256 referenced undeclared variable
`tls1` instead of `tls`, a copy-paste typo from commit a975ba9
(2019). This caused a compilation error when both WOLFSSL_STATIC_PSK
and WOLFSSL_OLDTLS_SHA2_CIPHERSUITES were defined.

Add PSK CI config with WOLFSSL_OLDTLS_SHA2_CIPHERSUITES to prevent
regressions.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
@sameehj
Copy link
Contributor Author

sameehj commented Mar 9, 2026

retest this please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant