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.
Creates a somewhat more permanent fix for #132. This makes use of a fix that I implemented in a fork of the obfs4 repo which treats an empty statedir string as
"Do NOT use local state"
rather than treating it as"./"
. To me this seems like a better and more explicit way to handle state (or lack there-of). For now I have added a PR against the upstream obfs4 repository Yawning/obfs4#35 and added areplace
in thego.mod
to use my fork in the hopes that it will be accepted soon at which time we can just remove thereplace
. Alternatively if that PR leads to some other fix we can support it here in a future PR.To re-iterate the problem: We use independent keys for each session making a connection using the obfs4 transport with the keys derived from the shared secret of the session. We want the server to be usable ONLY by the individual client that negotiated the session. However, since there is no option to not use
stateDir
in theServerFactory
, each session must create a unique directory that it can use as thestateDir
otherwise one session might parse another sessions secrets from the state files. The fix allows us to bypass the steps of parsing arguments from and writing arguments to the state directory.related: #135