Repository navigation
feat: shared strategy catalog package - #10
Merged
Merged
Conversation
Template, SNI and QUICOnly change the burst but were missing from the key, so a zero-payload burst and a QUIC Initial decoy with the same TTL had the same key and the same derived strategy ID. They are appended only when set, so keys of existing bursts are unchanged.
The presets package holds the TCP catalog of desync-probe and a UDP burst catalog (zero-payload and QUIC Initial decoys at several TTLs and burst sizes) with stable IDs derived from the options' Key: s + 10 hex digits of SHA-256 for TCP, as desync-probe reports them, u + 10 for UDP. Available filters by Capabilities with the reason from Unsupported and drops what Validate rejects here; Filter answers for any platform's capabilities. Rank and Ranked suggest trying cheap, robust strategies first; ByID and the ID text type let applications persist only the ID.
The built-in catalog, the capability filter and the ID derivation moved to the presets package. Names, order, IDs, skip reasons and the report schema are unchanged; -list-presets prints the same output.
CatalogVersion hashes the candidate IDs in order. Joined IDs exceed the 128-byte limit of controller.Config.PolicyVersion; a test checks that the controller accepts every catalog ID with it.
README section on the presets package with every preset, its ID, rank and needed features and the ordering rationale; the controller document uses preset IDs as candidates and CatalogVersion in the policy version; the vNext status lists the catalog.
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.
github.com/Nemu-x/desync/presets: one strategy catalog for apps anddesync-probe, so a strategy ID from a tester's report is the same ID an app caches and selects.Preset{Name, Description, Options, Needs, Rank}withID()andKey();UDPPresetwrapsUDPOptions. IDs:"s"+ 10 hex of sha256(Options.Key()) exactly as the probe computed them (the four pinned IDs unchanged),"u"+ 10 for UDP.TCP()(23 presets: baseline, record cuts, write splits, random cuts, disorder, oob, disoob, split waits, fake TTL 3/5/8, fake with decoy SNI, fake among split pieces, disorder + fake) andUDP()(9: zero and QUIC templates, TTL and repeat variants; the QUIC ones are QUIC-only).Filter/FilterUDP(ps, caps)decide from capabilities alone (answers for another OS);Available/AvailableUDP(caps)also drop whatValidaterejects here and return the skipped ones with reasons fromCapabilities.Unsupported.Ranked/RankedUDP: try cheap and robust first — baseline, record splits, write splits, split waits, disorder/OOB, fakes, fake + disorder last (a fake whose TTL reaches the server breaks the handshake). UDP: fewer extra datagrams first. Reasoning, not measurements.ByID,IDs,UDPIDs;type ID(JSON string; malformed rejected, unknown well-formed kept so settings from another version load);CatalogVersion(ids)forcontroller.Config.PolicyVersion, which the joined IDs would overflow.desync-probetakes its strategies from the package;-list-presetsoutput and the report are byte-identical to before.UDPOptions.Key()left outTemplate,SNIandQUICOnly, so a zero burst and a QUIC decoy with the same TTL had one key and one ID. They are appended only when set: existing UDP keys don't change.Tests: golden names and IDs for every preset, ordering,
Filter/Availablefor simulated windows/linux/darwin/no-methods with exact lists and reasons, simulation matchesPlatformCapabilities()on the host, every kept preset validates,ByID/JSON round trips, the controller accepts all IDs withCatalogVersion. gofmt, vet windows/linux/darwin on Go 1.26.10 and 1.20.14; tests on Windows (both) and Linux in Docker (1.26.9-race, 1.20.14). Not verified: macOS runtime (CI), real networks.