[Pkg-privacy-commits] [obfsproxy] 204/353: Obfs2 uses setup classmethod to save shared secret
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 13:02:00 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 5679a30d8f364157789787e8f5c6d6b8c33d5e29
Author: David Stainton <dstainton415 at gmail.com>
Date: Mon Nov 11 22:22:08 2013 -0800
Obfs2 uses setup classmethod to save shared secret
---
obfsproxy/transports/obfs2.py | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/obfsproxy/transports/obfs2.py b/obfsproxy/transports/obfs2.py
index 8fb61b2..3b687a5 100644
--- a/obfsproxy/transports/obfs2.py
+++ b/obfsproxy/transports/obfs2.py
@@ -54,12 +54,6 @@ class Obfs2Transport(base.BaseTransport):
def __init__(self, transport_config):
"""Initialize the obfs2 pluggable transport."""
- # Check for shared-secret in the server transport options.
- transport_options = transport_config.getServerTransportOptions()
- if transport_options and "shared-secret" in transport_options:
- log.debug("Setting shared-secret from server transport options: '%s'", transport_options["shared-secret"])
- self.shared_secret = transport_options["shared-secret"]
-
# Check if the shared_secret class attribute was already
# instantiated. If not, instantiate it now.
if not hasattr(self, 'shared_secret'):
@@ -104,6 +98,16 @@ class Obfs2Transport(base.BaseTransport):
self.pending_data_to_send = False
@classmethod
+ def setup(cls, transport_config):
+ """Setup the obfs2 pluggable transport."""
+
+ # Check for shared-secret in the server transport options.
+ transport_options = transport_config.getServerTransportOptions()
+ if transport_options and "shared-secret" in transport_options:
+ log.debug("Setting shared-secret from server transport options: '%s'", transport_options["shared-secret"])
+ cls.shared_secret = transport_options["shared-secret"]
+
+ @classmethod
def register_external_mode_cli(cls, subparser):
subparser.add_argument('--shared-secret', type=str, help='Shared secret')
--
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