[Pkg-privacy-commits] [obfsproxy] 81/353: Kill obfs3/dust transports. They did not work.

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:01:42 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 04bc2bfe647dbf4c2047fe8ecde0c165a369d33c
Author: George Kadianakis <desnacked at riseup.net>
Date:   Fri Nov 2 04:33:12 2012 +0200

    Kill obfs3/dust transports. They did not work.
---
 obfsproxy/transports/dust_transport.py | 116 --------------------------------
 obfsproxy/transports/obfs3.py          | 117 ---------------------------------
 obfsproxy/transports/transports.py     |   5 --
 3 files changed, 238 deletions(-)

diff --git a/obfsproxy/transports/dust_transport.py b/obfsproxy/transports/dust_transport.py
deleted file mode 100644
index c5d2c96..0000000
--- a/obfsproxy/transports/dust_transport.py
+++ /dev/null
@@ -1,116 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-"""
-The dust_transport module contains the DustDaemon, DustClient, and DustServer classes which implement the Dust transport.
-"""
-
-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
-
-HANDSHAKE_SIZE = IV_SIZE + KEY_SIZE
-
-
-class DustDaemon(BaseDaemon):
-
-    """
-    DustDaemon is the base class for DustClient and DustServer.
-    It implements the functionality which is common across both the client and server implementations.
-    """
-
-    def __init__(self, circuit):
-        """
-        Initializes the daemon with a downstream and upstream socket.
-        This also sets the protocol state to HANDSHAKE_WRITE and generates an ephemeral keypair.
-        """
-
-        BaseDaemon.__init__(self, circuit)
-
-        self.state = HANDSHAKE_WRITE
-        self.ekeypair = createEphemeralKeypair()
-        self.epub = bytes('')
-
-    def start(self):
-        """
-        This is the callback method which is called by the framework when a new connection has been made.
-        In the Dust protocol, on start the public part of the ephemeral keypair is written upstream.
-        """
-
-        self.upstreamConnection.write(self.ekeypair.public.bytes)
-
-    def receivedDownstream(self):
-        """
-        This is the callback method which is called by the framework when bytes have been received on the downstream socket.
-        In the Dust protocol, downstream bytes are buffered until the handshake is complete and the protocol is in STREAM mode, at which point all bytes received from downstream are encrypted and sent upstream.
-        """
-
-        # If we're in streaming mode, encode and write the incoming data
-
-        if self.state == STREAM:
-            data = self.downstreamConnection.read_some()
-            if data:
-                self.upstreamConnection.write(self.coder.encode(data))
-
-        # Else do nothing, data will buffer until we've done the handshake
-
-    def receivedUpstream(self, data):
-        """
-        This is the callback method which is called by the framework when bytes have been received on the upstream socket.
-        In the Dust protocol, the upstream handshake is read, and then the protocol is switched to STREAM mode, at which point all bytes received from upstream are encrypted and sent downstream.
-        """
-
-        if self.state == HANDSHAKE:
-            self.epub = self.read(self.upstreamConnection, self.epub,
-                                  HANDSHAKE_SIZE)
-            if self.checkTransition(self.epub, HANDSHAKE_SIZE, STREAM):
-                esession = makeEphemeralSession(self.ekeypair,
-                        self.epub)
-                self.coder = lite_socket(esession)
-
-                data = self.downstreamConnection.read_some()
-                if data:
-                    self.upstreamConnection.write(self.coder.encode(data))
-
-                data = self.upstreamConnection.read_some()
-                if data:
-                    self.downstreamConnection.write(self.coder.decode(data))
-        else:
-            data = self.upstreamConnection.read_some()
-            if data:
-                self.downstreamConnection.write(self.coder.decode(data))
-
-    def end(self):
-        """
-        This is the callback method which is called by the framework when the connection is closed.
-        In DustDaemon it does nothing.
-        """
-
-        pass
-
-
-class DustClient(DustDaemon):
-
-    """
-    DustClient is a client for the Dust protocol.
-    In this simplified implementation of the protocol, the client and the server are identical and both just trivially subclass DustDaemon.
-    """
-
-    pass
-
-
-class DustServer(DustDaemon):
-
-    """
-    DustServer is a server for the Dust protocol.
-    In this simplified implementation of the protocol, the client and the server are identical and both just trivially subclass DustDaemon.
-    """
-
-    pass
-
-
diff --git a/obfsproxy/transports/obfs3.py b/obfsproxy/transports/obfs3.py
deleted file mode 100644
index 2bb34a3..0000000
--- a/obfsproxy/transports/obfs3.py
+++ /dev/null
@@ -1,117 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-"""
-The obfs3 module implements the obfs3 protocol.
-"""
-
-from dust.extensions.lite.lite_socket2 import makeSession, \
-    makeEphemeralSession, createEphemeralKeypair
-from dust.core.dust_packet import IV_SIZE, KEY_SIZE
-
-from obfsproxy.common.aes import AESCoder
-from obfsproxy.transports.base import BaseDaemon
-
-HANDSHAKE = 0
-STREAM = 1
-
-HANDSHAKE_SIZE = IV_SIZE + KEY_SIZE
-
-
-class Obfs3Daemon(BaseDaemon):
-
-    """
-    Obfs2Daemon implements the obfs2 protocol.
-    It is subclassed by Obfs2Client and Obfs2Server.
-    """
-
-    def __init__(self, circuit):
-        """
-        Initializes the daemon with a downstream and upstream socket.
-        This also sets the protocol state to HANDSHAKE_WRITE and generates an ephemeral keypair.
-        """
-
-        BaseDaemon.__init__(self, circuit)
-
-        self.state = HANDSHAKE_WRITE
-        self.ekeypair = createEphemeralKeypair()
-        self.epub = bytes('')
-
-    def start(self):
-        """
-        This is the callback method which is called by the framework when a new connection has been made.
-        In the obfs3 protocol, on start the public part of the ephemeral keypair is written upstream.
-        """
-
-        self.upstreamConnection.write(self.ekeypair.public.bytes)
-
-    def receivedDownstream(self):
-        """
-        This is the callback method which is called by the framework when bytes have been received on the downstream socket.
-        In the obfs3 protocol, downstream bytes are buffered until the handshake is complete and the protocol is in STREAM mode, at which point all bytes received from downstream are encrypted and sent upstream.
-        """
-
-        # If we're in streaming mode, encode and write the incoming data
-
-        if self.state == STREAM:
-            data = self.downstreamConnection.read_some()
-            if data:
-                self.upstreamConnection.write(self.coder.encode(data))
-
-        # Else do nothing, data will buffer until we've done the handshake
-
-    def receivedUpstream(self, data):
-        """
-        This is the callback method which is called by the framework when bytes have been received on the upstream socket.
-        In the obfs3 protocol, the upstream handshake is read, and then the protocol is switched to STREAM mode, at which point all bytes received from upstream are encrypted and sent downstream.
-        """
-
-        if self.state == HANDSHAKE:
-            self.epub = self.read(self.upstreamConnection, self.epub,
-                                  HANDSHAKE_SIZE)
-            if self.checkTransition(self.epub, HANDSHAKE_SIZE, STREAM):
-                esession = makeEphemeralSession(self.ekeypair,
-                        self.epub)
-                self.coder = AESCoder(esession)
-
-                data = self.downstreamConnection.read_some()
-                if data:
-                    self.upstreamConnection.write(self.coder.encode(data))
-
-                data = self.upstreamConnection.read_some()
-                if data:
-                    self.downstreamConnection.write(self.coder.decode(data))
-        else:
-            data = self.upstreamConnection.read_some()
-            if data:
-                self.downstreamConnection.write(self.coder.decode(data))
-
-    def end(self):
-        """
-        This is the callback method which is called by the framework when the connection is closed.
-        In Obfs3Daemon it does nothing.
-        """
-
-        pass
-
-
-class Obfs3Client(Obfs3Daemon):
-
-    """
-    Obfs3Client is a client for the obfs3 protocol.
-    In this simplified implementation of the protocol, the client and the server are identical and both just trivially subclass DustDaemon.
-    """
-
-    pass
-
-
-class Obfs3Server(Obfs3Daemon):
-
-    """
-    Obfs3Server is a server for the obfs3 protocol.
-    In this simplified implementation of the protocol, the client and the server are identical and both just trivially subclass DustDaemon.
-    """
-
-    pass
-
-
diff --git a/obfsproxy/transports/transports.py b/obfsproxy/transports/transports.py
index 7de7c2c..d2b6d23 100644
--- a/obfsproxy/transports/transports.py
+++ b/obfsproxy/transports/transports.py
@@ -1,16 +1,11 @@
 # XXX modulify transports and move this to a single import
 import obfsproxy.transports.dummy as dummy
 import obfsproxy.transports.b64 as b64
-# XXX broken transports
-#import obfsproxy.transports.dust_transport as dust
 import obfsproxy.transports.obfs2 as obfs2
-#import obfsproxy.transports.obfs3 as obfs3
 
 transports = { 'dummy' : {'client' : dummy.DummyClient, 'socks' : dummy.DummyClient, 'server' : dummy.DummyServer },
                'b64' : {'client' : b64.B64Client, 'socks' : b64.B64Client, 'server' : b64.B64Server },
-#               'dust' :  {'client' : dust.DustClient, 'socks' : dust.DustClient, 'server' : dust.DustServer } }
                'obfs2' : {'client' : obfs2.Obfs2Client, 'socks' : obfs2.Obfs2Client,  'server' : obfs2.Obfs2Server } }
-#               'obfs3' : {'client' : obfs3.Obfs3Client, 'socks' : obfs3.Obfs3Client,  'server' : obfs3.Obfs3Server }
 
 def get_transport_class(name, role):
     if (name in transports) and (role in transports[name]):

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