[Pkg-privacy-commits] [obfsproxy] 212/353: Trivial edits and ChangeLog entry for #10243.

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:02:01 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository obfsproxy.

commit fbfe12cd302337f2a4300bdf03305e8eeb1e4b47
Author: George Kadianakis <desnacked at riseup.net>
Date:   Thu Nov 28 19:20:43 2013 +0000

    Trivial edits and ChangeLog entry for #10243.
---
 ChangeLog                    |  4 ++++
 obfsproxy/managed/server.py  | 13 +++++++------
 obfsproxy/transports/base.py | 10 +++++-----
 3 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b784de2..c505636 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,10 @@ Changes in version 0.2.5 - UNRELEASED
    Fixes #10031 and adds gmpy as a dependency. Patch by Philipp Winter.
  - Add a setup() method that gets called on obfsproxy startup and
    can be used by transports for expensive initializations.
+ - Add a transport method called get_public_server_options() that allows
+   transports to filter server-side options that should not be announced
+   to BridgeDB (because they might leak filesystem paths etc.) .
+   Patch by David Stainton. Fixes #10243.
 
 
 Changes in version 0.2.4 - 2013-09-30
diff --git a/obfsproxy/managed/server.py b/obfsproxy/managed/server.py
index 6dad098..92d4c9a 100644
--- a/obfsproxy/managed/server.py
+++ b/obfsproxy/managed/server.py
@@ -79,14 +79,15 @@ def do_managed_server():
             extra_log = " (server transport options: '%s')" % str(transport_options)
         log.debug("Successfully launched '%s' at '%s'%s" % (transport, log.safe_addr_str(str(addrport)), extra_log))
 
-        # Potentially filter the transport options
-        # with the transport's get_public_options() method
-        public_options_dict = transport_class.get_public_options(transport_options)
+        # Invoke the transport-specific get_public_server_options()
+        # method to potentially filter the server transport options
+        # that should be passed on to Tor and eventually to BridgeDB.
+        public_options_dict = transport_class.get_public_server_options(transport_options)
         public_options_str  = None
 
-        # if we have filter
-        if public_options_dict is not None:
-            optlist            = []
+        # If the transport filtered its options:
+        if public_options_dict:
+            optlist = []
             for k, v in public_options_dict.items():
                 optlist.append("%s=%s" % (k,v))
             public_options_str = ",".join(optlist)
diff --git a/obfsproxy/transports/base.py b/obfsproxy/transports/base.py
index dccbf6c..f3f65e5 100644
--- a/obfsproxy/transports/base.py
+++ b/obfsproxy/transports/base.py
@@ -46,7 +46,7 @@ class BaseTransport(object):
         pass
 
     @classmethod
-    def get_public_options(cls, transport_options):
+    def get_public_server_options(cls, transport_options):
         """
         By default all server transport options are passed to BridgeDB.
         If the transport server wishes to prevent some server
@@ -54,7 +54,7 @@ class BaseTransport(object):
         the transport may override this method and return a
         transport_options dict with the keys/values to be distributed.
 
-        get_public_options receives the transport_options argument which
+        get_public_server_options receives the transport_options argument which
         is a dict of server transport options... for example:
 
         A torrc could specify multiple server transport options:
@@ -63,13 +63,13 @@ class BaseTransport(object):
         ServerTransportOptions bananaphone corpus=/opt/bananaphone-corpora/pg29468.txt encodingSpec=words,sha1,4 modelName=markov order=1
 
         But if the transport wishes to only pass the encodingSpec to
-        the BridgeDB then get_public_options can be overridden like this:
+        the BridgeDB then get_public_server_options can be overridden like this:
 
         @classmethod
-        def get_public_options(cls, transport_options):
+        def get_public_server_options(cls, transport_options):
             return dict(encodingSpec = transport_options['encodingSpec'])
 
-        In this example the get_public_options receives the transport_options dict:
+        In this example the get_public_server_options receives the transport_options dict:
         {'corpus': '/opt/bananaphone-corpora/pg29468.txt', 'modelName': 'markov', 'order': '1', 'encodingSpec': 'words,sha1,4'}
         """
         return None

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/obfsproxy.git



More information about the Pkg-privacy-commits mailing list