[Pkg-privacy-commits] [obfsproxy] 22/353: Fixed syntax and import errors
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 13:01:34 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 0d3d5b9f1c7277070044cb447c760fb494ff7777
Author: Brandon Wiley <brandon at blanu.net>
Date: Wed Aug 1 16:20:30 2012 -0500
Fixed syntax and import errors
---
src/obfsproxy/framework/external/__init__.py | 3 --
src/obfsproxy/framework/external/client.py | 71 ----------------------------
src/obfsproxy/framework/external/server.py | 70 ---------------------------
src/obfsproxy/framework/proxy.py | 2 +
src/obfsproxy/framework/socks.py | 2 +
src/obfsproxy/transports/dummy.py | 2 +-
src/obfsproxy/transports/dust_transport.py | 2 +
src/obfsproxy/transports/obfs2.py | 5 +-
src/obfsproxy/transports/obfs3.py | 1 +
9 files changed, 11 insertions(+), 147 deletions(-)
diff --git a/src/obfsproxy/framework/external/__init__.py b/src/obfsproxy/framework/external/__init__.py
deleted file mode 100644
index e0e3e1a..0000000
--- a/src/obfsproxy/framework/external/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
diff --git a/src/obfsproxy/framework/external/client.py b/src/obfsproxy/framework/external/client.py
deleted file mode 100755
index 50beb8a..0000000
--- a/src/obfsproxy/framework/external/client.py
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-import os
-import sys
-
-import argparse
-
-from struct import unpack
-from socket import inet_ntoa
-
-import monocle
-from monocle import _o, Return
-monocle.init('tornado')
-
-from monocle.stack import eventloop
-from monocle.stack.network import add_service, Service, Client, \
- ConnectionLost
-from pyptlib.framework.loopback import FakeSocket
-
-from pyptlib.framework.socks import SocksHandler
-
-from pyptlib.config.config import EnvException
-from pyptlib.config.client import ClientConfig
-from pyptlib.framework.daemon import *
-
-from pyptlib.transports.dummy import DummyClient
-
-
-class ManagedClient(Daemon):
-
- def __init__(self):
- try:
- Daemon.__init__(self, ClientConfig(), SocksHandler())
- except EnvException:
- print 'error 0'
- return
- except UnsupportedManagedTransportVersionException:
- print 'error 1'
- return
- except NoSupportedTransportsException:
- print 'error 2'
- return
-
- try:
- self.launchClient(self.supportedTransport, 8182)
- self.config.writeMethod(self.supportedTransport, 5,
- ('127.0.0.1', 8182), None, None)
- except TransportLaunchException, e:
- print 'error 3'
- self.config.writeMethodError(self.supportedTransport,
- e.message)
-
- self.config.writeMethodEnd()
-
- self.run()
-
- def launchClient(self, name, port):
- if name != self.supportedTransport:
- raise TransportLaunchException('Tried to launch unsupported transport %s'
- % name)
-
- client = DummyClient()
- self.handler.setTransport(client)
- add_service(Service(self.handler, port=port))
-
-
-if __name__ == '__main__':
- sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
- server = ManagedClient()
-
diff --git a/src/obfsproxy/framework/external/server.py b/src/obfsproxy/framework/external/server.py
deleted file mode 100755
index 61c0d1b..0000000
--- a/src/obfsproxy/framework/external/server.py
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-import os
-import sys
-
-from struct import unpack
-from socket import inet_ntoa
-
-import monocle
-from monocle import _o, Return
-monocle.init('tornado')
-
-from monocle.stack import eventloop
-from monocle.stack.network import add_service, Service, Client
-
-from pyptlib.framework.shared import pump
-
-from pyptlib.config.config import EnvException
-from pyptlib.config.server import ServerConfig, MethodOptions
-from pyptlib.framework.daemon import *
-
-from pyptlib.framework.proxy import ProxyHandler
-
-from pyptlib.transports.dummy import DummyServer
-
-
-class ManagedServer(Daemon):
-
- def __init__(self):
- try:
- Daemon.__init__(self, ServerConfig(), ProxyHandler())
- except EnvException:
- print 'error 0'
- return
- except UnsupportedManagedTransportVersionException:
- print 'error 1'
- return
- except NoSupportedTransportsException:
- print 'error 2'
- return
-
- try:
- self.launchServer(self.supportedTransport, 8182)
- self.config.writeMethod(self.supportedTransport,
- ('127.0.0.1', 8182),
- MethodOptions())
- except TransportLaunchException, e:
- print 'error 3'
- self.config.writeMethodError(self.supportedTransport,
- e.message)
-
- self.config.writeMethodEnd()
-
- self.run()
-
- def launchServer(self, name, port):
- if name != self.supportedTransport:
- raise TransportLaunchException('Tried to launch unsupported transport %s'
- % name)
-
- client = DummyServer()
- self.handler.setTransport(client)
- add_service(Service(self.handler, port=port))
-
-
-if __name__ == '__main__':
- sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
- server = ManagedServer()
-
diff --git a/src/obfsproxy/framework/proxy.py b/src/obfsproxy/framework/proxy.py
index 5059d58..7940086 100644
--- a/src/obfsproxy/framework/proxy.py
+++ b/src/obfsproxy/framework/proxy.py
@@ -5,6 +5,8 @@ from struct import unpack
from socket import inet_ntoa
import monocle
+monocle.init('tornado')
+
from monocle import _o, Return
from monocle.stack.network import Client
diff --git a/src/obfsproxy/framework/socks.py b/src/obfsproxy/framework/socks.py
index 114a28f..233fc81 100644
--- a/src/obfsproxy/framework/socks.py
+++ b/src/obfsproxy/framework/socks.py
@@ -5,6 +5,8 @@ from struct import unpack
from socket import inet_ntoa
import monocle
+monocle.init('tornado')
+
from monocle import _o, Return
from monocle.stack.network import Client
diff --git a/src/obfsproxy/transports/dummy.py b/src/obfsproxy/transports/dummy.py
index f9086b6..43d392c 100644
--- a/src/obfsproxy/transports/dummy.py
+++ b/src/obfsproxy/transports/dummy.py
@@ -12,7 +12,7 @@ class DummyDaemon(BaseDaemon):
data=self.encodedSocket.readAll()
self.decodedSocket.write(data)
-class DummyClient(DummyDaemon:
+class DummyClient(DummyDaemon):
pass
class DummyServer(DummyDaemon):
diff --git a/src/obfsproxy/transports/dust_transport.py b/src/obfsproxy/transports/dust_transport.py
index cd3a03a..2da0436 100644
--- a/src/obfsproxy/transports/dust_transport.py
+++ b/src/obfsproxy/transports/dust_transport.py
@@ -4,6 +4,8 @@
from dust.extensions.lite.lite_socket2 import lite_socket, makeSession, makeEphemeralSession, createEphemeralKeypair
from dust.core.dust_packet import IV_SIZE, KEY_SIZE
+from obfsproxy.transports.base import BaseDaemon
+
HANDSHAKE=0
STREAM=1
diff --git a/src/obfsproxy/transports/obfs2.py b/src/obfsproxy/transports/obfs2.py
index 25307be..00952f4 100644
--- a/src/obfsproxy/transports/obfs2.py
+++ b/src/obfsproxy/transports/obfs2.py
@@ -10,6 +10,7 @@ import base64
from obfsproxy.crypto.aes import AESCoder
from obfsproxy.util import decode, uncompact
+from obfsproxy.transports.base import BaseDaemon
MAGIC_VALUE = decode('2BF5CA7E')
SEED_LENGTH = 16
@@ -159,13 +160,13 @@ class Obfs2Daemon(BaseDaemon):
def end(self):
pass
-class Obfs2Client(Obfs3Daemon):
+class Obfs2Client(Obfs2Daemon):
def __init__(self, decodedSocket, encodedSocket):
self.padString='Initiator obfuscation padding'
self.otherPadString='Responder obfuscation padding'
-class Obfs2Server(Obfs3Daemon):
+class Obfs2Server(Obfs2Daemon):
def __init__(self, decodedSocket, encodedSocket):
self.padString='Responder obfuscation padding'
diff --git a/src/obfsproxy/transports/obfs3.py b/src/obfsproxy/transports/obfs3.py
index c4b4643..72644d0 100644
--- a/src/obfsproxy/transports/obfs3.py
+++ b/src/obfsproxy/transports/obfs3.py
@@ -5,6 +5,7 @@ from dust.extensions.lite.lite_socket2 import makeSession, makeEphemeralSession,
from dust.core.dust_packet import IV_SIZE, KEY_SIZE
from obfsproxy.crypto.aes import AESCoder
+from obfsproxy.transports.base import BaseDaemon
HANDSHAKE=0
STREAM=1
--
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