tls: exclude PKCS#1 v1.5 RSA from TLS 1.3 signature_algorithms extension#5
Draft
kareem-wolfssl with Copilot wants to merge 1 commit into
Draft
tls: exclude PKCS#1 v1.5 RSA from TLS 1.3 signature_algorithms extension#5kareem-wolfssl with Copilot wants to merge 1 commit into
kareem-wolfssl with Copilot wants to merge 1 commit into
Conversation
Copilot
AI
changed the title
Filter PKCS#1 v1.5 RSA sig algs from TLS 1.3 signature_algorithms extension
tls: exclude PKCS#1 v1.5 RSA from TLS 1.3 signature_algorithms extension
Jul 23, 2026
Copilot created this pull request from a session on behalf of
kareem-wolfssl
July 23, 2026 23:31
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
wolfSSL was unconditionally advertising
rsa_sa_algo(PKCS#1 v1.5 RSA) in thesignature_algorithmsextension even for TLS 1.3 ClientHellos, violating RFC 8446 §4.2.3. The fix operates at three layers to handle both TLS 1.3-only and downgrade-capable builds correctly.Changes
src/internal.c—InitSuitesHashSigAlgo()Under
WOLFSSL_NO_TLS12(TLS 1.3-only builds), gatersa_sa_algoadditions withif (!tls1_3). In mixed-version builds the in-memory list intentionally retainsrsa_sa_algo— the ClientHello is sent before version negotiation completes, so it must remain available for a TLS 1.2 fallback.src/tls.c—TLSX_SignatureAlgorithms_GetSize()/TLSX_SignatureAlgorithms_Write()Runtime wire-level filter: when
IsAtLeastTLSv1_3(ssl->version) && !ssl->options.downgrade, striprsa_sa_algopairs (list[i+1] == rsa_sa_algo) from the serialised extension without touching the in-memory list.GetSizeandWriteuse the identical condition so the reported and written lengths always agree. Whenssl->options.downgradeis set the filter is skipped, preserving TLS 1.2 compatibility.src/tls13.c—DoTls13ServerHello()downgrade pathAfter
ssl->options.tls1_3 = 0is set on a confirmed TLS 1.3→1.2 downgrade (viasupported_versions), scansuites->hashSigAlgofor anyrsa_sa_algoentry; if absent, rebuild withInitSuitesHashSigAlgo(..., tls1_3=0)soPickHashSigAlgoandCertificateVerifyhave the full PKCS#1 v1.5 RSA set for TLS 1.2 processing.Downgrade flow (preserved)
rsa_sa_algopresent on wire (filter skipped)ssl->version.minor = TLSv1_2_MINOR,tls1_3 = 0rsa_sa_algorestored inhashSigAlgoif missingPickHashSigAlgo