callebtc c679b4a477 protocol: drop compression ratio guard, keep absolute cap + streaming
Addresses review feedback: the 100:1 ratio guard created an
encoder/decoder asymmetry — encode() compresses any beneficial payload,
but legitimate high-ratio content (repeated text, zero-filled files,
>100:1) was then rejected by every receiver, so decode(encode(packet))
failed and messages were silently dropped by all peers. It also
diverged from iOS, which enforces no ratio limit.

The ratio check is redundant for security: the absolute
MAX_PAYLOAD_LENGTH cap plus the bounded streaming decompressor (which
never pre-allocates the claimed size) already limit worst-case
allocation to actual inflated output.

Replaces the ratio-rejection test with a high-ratio round-trip test and
updates stale comments on the pre-existing bomb tests.
2026-07-27 04:41:55 +02:00
..
2025-12-14 21:55:41 +07:00