Skip to content

Commit

Permalink
Don't use writeMergeConn with Conjure decoy registration
Browse files Browse the repository at this point in the history
  • Loading branch information
rod-hynes committed Dec 16, 2024
1 parent 1f9a9a6 commit 36a4b87
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions psiphon/common/refraction/refraction.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,15 @@ func dial(
refractionDialer.Transport = transport.ID()
refractionDialer.TransportConfig = config
refractionDialer.DisableRegistrarOverrides = disableOverrides
refractionDialer.DialerWithLaddr = newWriteMergeDialer(
refractionDialer.DialerWithLaddr, false, 32)
if !conjureConfig.DoDecoyRegistration {
// Limitation: the writeMergeConn wrapping is skipped when
// using decoy registration, since the refraction package
// uses DialerWithLaddr for both the decoy registration step
// as well as the following phantom dial, and the
// writeMergeConn is only appropriate for the phantom dial.
refractionDialer.DialerWithLaddr = newWriteMergeDialer(
refractionDialer.DialerWithLaddr, false, 32)
}

case protocol.CONJURE_TRANSPORT_PREFIX_OSSH:

Expand All @@ -442,8 +449,11 @@ func dial(
refractionDialer.Transport = transport.ID()
refractionDialer.TransportConfig = config
refractionDialer.DisableRegistrarOverrides = disableOverrides
refractionDialer.DialerWithLaddr = newWriteMergeDialer(
refractionDialer.DialerWithLaddr, true, 64)
if !conjureConfig.DoDecoyRegistration {
// See limitation comment above.
refractionDialer.DialerWithLaddr = newWriteMergeDialer(
refractionDialer.DialerWithLaddr, true, 64)
}

case protocol.CONJURE_TRANSPORT_DTLS_OSSH:

Expand Down

0 comments on commit 36a4b87

Please sign in to comment.