[Pkg-privacy-commits] [obfsproxy] 131/353: Always initialize the shared_secret attribute in obfs2 code.

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:01:50 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 4bf9607fa37ab13c74ee0e21ecd5d02cdaddc315
Author: George Kadianakis <desnacked at riseup.net>
Date:   Wed Mar 13 23:59:13 2013 -0400

    Always initialize the shared_secret attribute in obfs2 code.
    
    Otherwise we got nasty AttributeErrors when running in managed-mode.
---
 obfsproxy/transports/obfs2.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/obfsproxy/transports/obfs2.py b/obfsproxy/transports/obfs2.py
index 98ed09a..9c4ed61 100644
--- a/obfsproxy/transports/obfs2.py
+++ b/obfsproxy/transports/obfs2.py
@@ -69,6 +69,11 @@ class Obfs2Transport(base.BaseTransport):
     def __init__(self):
         """Initialize the obfs2 pluggable transport."""
 
+        # Check if the shared_secret class attribute was instantiated
+        # by external-mode code. If not, instantiate it now.
+        if not hasattr(self, 'shared_secret'):
+            self.shared_secret = None
+
         if self.shared_secret:
             log.debug("Starting obfs2 with shared secret: %s" % self.shared_secret)
 
@@ -112,8 +117,6 @@ class Obfs2Transport(base.BaseTransport):
     def validate_external_mode_cli(cls, args):
         if args.shared_secret:
             cls.shared_secret = args.shared_secret
-        else:
-            cls.shared_secret = None
 
         super(Obfs2Transport, cls).validate_external_mode_cli(args)
 

-- 
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