Closed ignoramous closed 3 months ago
Since this is a private function, and we are not using the returned bytes
splitter
(which impls io.Writer
via DuplexConn
) does use n
returned from splitHello
.
Please do not use this function elsewhere. For reusable TLS fragmentation, use the Outline SDK. (We plan to refactor our code using the Outline SDK in the future as well)
Ah, thanks.
We may or may not subtract the header length from n, depending on the bytes that has been written ... I recommend leaving it unchanged
I didn't quite catch this. I guess what you're saying is, the splits might have written n
/ m
bytes (partially so) that need to be subtracted from to account for record size changes due to fragmentation?
You reckon we change splitter.Write
to confirm to io.Writer
, or make more accurate accounting related changes in splitHello
, or close this PR (as this issue needs to be fixed elsewhere, presumably in the outline-sdk
)?
Thanks @ignoramous for your response. I suggest closing this PR if its purpose is solely for third-party use (Outline SDK is a more suitable API with proper handling of written bytes), since we'll be refactoring this logic anyway.
However, if you're aware of any Intra use cases that might be affected, we may need to fix it.
we'll be refactoring this logic anyway.
Gotcha.
However, if you're aware of any Intra use cases that might be affected, we may need to fix it.
Well, only splitter
(aka direct_split
) but it isn't used by Intra anymore, even though (as it was recently brought to my attention), direct_split
in fact works better in face of "residual censorship" than the retrier
.
(appreciate for your input. closing...)
The way our Intra fork is written, writing to
retrier
(DuplexConn
) viaio.Copy
results in panic when total written bytes from TLS fragmentation exceeds the length of the input bytes; expected since this behaviour violates theio.Writer.Write
contract:https://github.com/celzero/firestack/commit/ba0c57c3851ce8c08c2f392b57a1890a936c803c