Skip to content

TLS KeyShare dissection boundary, remove conf.debug_dissector, and import test infrastructure#4957

Open
ali-keys wants to merge 3 commits intosecdev:masterfrom
ali-keys:fix/tls-keyshare-imports
Open

TLS KeyShare dissection boundary, remove conf.debug_dissector, and import test infrastructure#4957
ali-keys wants to merge 3 commits intosecdev:masterfrom
ali-keys:fix/tls-keyshare-imports

Conversation

@ali-keys
Copy link
Copy Markdown

Hi everyone,

This PR fixes three things:

TLS_Ext_KeyShare_SH: fix server_share boundary

server_share used PacketField (no length bound), causing it to
consume subsequent extensions. Replaced with PacketLenField bounded
by the extension's own length field.

contrib/automotive/uds: remove conf.debug_dissector side-effect

In uds.py, conf.debug_dissector = True has been left by accident.
I noticed it during a TLS test where UDS was accidentally included from
my previous works. The config affected my TLS work. Removed it.

test/imports: fix pool bugs, add conf side-effect guard

The hand-rolled subprocess pool in import_all silently dropped
filenames when saturated, never drained the final batch, and had a
dead opening while-loop. Replaced with ThreadPoolExecutor (~2x
faster). + Added a test verifying no module mutates conf.debug_dissector
on import.

@ali-keys ali-keys force-pushed the fix/tls-keyshare-imports branch from aecd423 to 500887a Compare March 30, 2026 18:42
@polybassa
Copy link
Copy Markdown
Contributor

Thanks for the PR. Looks good.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.30%. Comparing base (9ae49f8) to head (b3204b5).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4957      +/-   ##
==========================================
- Coverage   80.30%   80.30%   -0.01%     
==========================================
  Files         379      379              
  Lines       93164    93163       -1     
==========================================
- Hits        74820    74815       -5     
- Misses      18344    18348       +4     
Files with missing lines Coverage Δ
scapy/contrib/automotive/uds.py 98.16% <ø> (-0.01%) ⬇️
scapy/layers/tls/keyexchange_tls13.py 79.89% <ø> (ø)

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ali-keys ali-keys force-pushed the fix/tls-keyshare-imports branch from 500887a to b3204b5 Compare March 31, 2026 10:05
…r check

The old import_all had three bugs: filenames could be silently dropped
when the pool was saturated (no blocking wait for a free slot), the
final batch was never drained, and the opening while-loop was dead code.

Replace append_processes/check_processes/import_all with
ThreadPoolExecutor, which handles queuing and draining correctly and
cuts total test time roughly in half.

Add a test verifying no module sets conf.debug_dissector as a side-effect
of import, using the same ALL_FILES exclusion list and subprocess isolation
as the existing import tests.
PacketField has no length bound, so server_share greedily consumed all
remaining bytes including subsequent extensions. Switch to PacketLenField
with length_from=pkt.len to bound dissection to the extension's own
length field.
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.

2 participants