obfsproxy transports should choose which options are passed to BridgeDB
I propose that obfsproxy transports should have a way to choose which server transport options are passed to the bridgeDB.
This was proposed by phw in tor#8979 3rd comment: https://trac.torproject.org/projects/tor/ticket/8979
My implementation is different: https://github.com/david415/obfsproxy/commits/david-transport-public-options
I added a new classmethod called get_public_options to BaseTransport that obfsproxy transports can choose to override. If the transport does override it then instead of the default behavior of passing all the server transport options to BridgeDB we only pass the options that are returned by the get_public_options method.
Here's how BananaphoneTransport uses it to only pass the encodingSpec: ( in this branch https://github.com/david415/obfsproxy/tree/david-bananaphone-public-options ) @classmethod def get_public_options(cls, transport_options): # make encodingSpec transport option public # if not specified then use the default value if 'encodingSpec' not in transport_options: return dict(encodingSpec = cls.encodingSpec) else: return dict(encodingSpec = transport_options['encodingSpec'])
Trac:
Username: david