Opened 7 years ago

Closed 7 years ago

#10243 closed enhancement (fixed)

obfsproxy transports should choose which options are passed to BridgeDB

Reported by: david Owned by: asn
Priority: Medium Milestone:
Component: Archived/Obfsproxy Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

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_optionsencodingSpec?)

Child Tickets

Change History (5)

comment:1 Changed 7 years ago by david

The above works because pyptlib's ServerTransportPlugin's reportMethodSuccess method either uses the options arg or it uses self.config.serverTransportOptions; see here:

https://gitweb.torproject.org/pluggable-transports/pyptlib.git/blob/HEAD:/pyptlib/server.py

comment:2 Changed 7 years ago by asn

Code looks good.

Could you please expand the function comment of get_public_options() to explain what transport_options is, and how it should be used? Maybe add an example or something.

comment:3 Changed 7 years ago by asn

Status: newneeds_revision

comment:4 Changed 7 years ago by david

OK. I've added sample code to explain things more clearly:
https://github.com/david415/obfsproxy/commits/david-transport-public-options

comment:5 Changed 7 years ago by asn

Resolution: fixed
Status: needs_revisionclosed

Merged and pushed! Thanks for the code!

Note: See TracTickets for help on using tickets.